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

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

kart2004
Copy link

@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

if (changeDelay > 0 && delayCall.current > 0) {
clearTimeout(delayCall.current);
delayCall.current = -1;
dispatch(createSendUpdateAction(updateVarName, val, module, onChange, propagate));
Copy link
Member

@FredLL-Avaiga FredLL-Avaiga Oct 15, 2024

Choose a reason for hiding this comment

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

this should always be called
So put outside the if/else block
I think you're right this should only be called if there is delayed call on hold
Sorry about the noise

Copy link
Member

Choose a reason for hiding this comment

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

But I still don't see any tests ;-)
Are you still working on this @kart2004 ?

@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

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