Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input control validation on focus out event #2036

Merged
merged 16 commits into from
Dec 2, 2024

Conversation

kart2004
Copy link
Contributor

@kart2004 kart2004 commented Oct 12, 2024

Description:

  • Fixes [🐛 BUG] [UX] input, number, date controls don't validate on focus out event #2023
  • Implemented onBlur event handler in the Input.tsx component to trigger value updates when an input field loses focus (focus out event).
  • Ensures that changes are captured even when the Enter key is not pressed, improving the overall user experience.
  • The change impacts text, number, and date input fields to align with the intended behavior.

image

Key changes include:

  • Added onBlur handler to TextField for focus out validation.
  • Ensured that value updates propagate correctly upon focus loss.

Ensured

  • Code is rebased
  • License is present
  • pre-commit works - without mypy error.
  • Taipy tests are passing.

image
image

Copy link
Member

@FredLL-Avaiga FredLL-Avaiga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any tests

frontend/taipy-gui/src/components/Taipy/Input.tsx Outdated Show resolved Hide resolved
@FabienLelaquais FabienLelaquais added 📈 Improvement Improvement of a feature. 🖰 GUI Related to GUI 🟨 Priority: Medium Not blocking but should be addressed hacktoberfest hacktoberfest issues hacktoberfest - 100💎 Issues rewarded by 100 points ✅ hacktoberfest: approved An approved PR for Hacktoberfest rewarding labels Nov 15, 2024
@RymMichaut
Copy link
Member

hey @kart2004, congrats on the merged PR.
Could you please reach out at [email protected] to organize your shipment?

@FabienLelaquais
Copy link
Member

@kart2004
As you certainly already know, the team has granted you the Hacktoberfest reward for your job on this matter.
Tests are still missing (as pointed out by @FredLL-Avaiga ), and I want to slightly change the original requirements after discussing that matter with actual users: we need to add a new Boolean property (like validate_on_blur) that if True would trigger the equivalent of pressing the Enter key should the change_delay property be set to 0 (no immediate update of the backend data).

Please let us know if you wish to finish this work or let us handle this.
Thanks!

@RymMichaut
Copy link
Member

please @kart2004 respond before EoW to ship, or you'd miss your swag

@FabienLelaquais
Copy link
Member

Finally, the new property is called 'action_on_blur' for homogeneity.

@FabienLelaquais FabienLelaquais requested review from FredLL-Avaiga and FlorianJacta and removed request for FabienLelaquais December 2, 2024 08:36
FredLL-Avaiga
FredLL-Avaiga previously approved these changes Dec 2, 2024
frontend/taipy-gui/src/components/Taipy/Input.tsx Outdated Show resolved Hide resolved
taipy/gui/viselements.json Show resolved Hide resolved
taipy/gui/viselements.json Show resolved Hide resolved
@FabienLelaquais FabienLelaquais merged commit 5a6ff90 into Avaiga:develop Dec 2, 2024
132 checks passed
@FabienLelaquais
Copy link
Member

@kart2004
FYI - Your PR was slightly modified to, in our opinion, better match the requirements that we've had.
Thanks again for your effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🖰 GUI Related to GUI hacktoberfest - 100💎 Issues rewarded by 100 points ✅ hacktoberfest: approved An approved PR for Hacktoberfest rewarding hacktoberfest hacktoberfest issues 📈 Improvement Improvement of a feature. 🟨 Priority: Medium Not blocking but should be addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[🐛 BUG] [UX] input, number, date controls don't validate on focus out event
4 participants