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

[form] 'on': 'blur' does not clear dropdown field error #2797

Open
mvorisek opened this issue May 22, 2023 · 4 comments
Open

[form] 'on': 'blur' does not clear dropdown field error #2797

mvorisek opened this issue May 22, 2023 · 4 comments
Labels
state/has-pr An issue which has a related PR open type/bug Any issue which is a bug or PR which fixes a bug
Milestone

Comments

@mvorisek
Copy link
Contributor

Bug Report

Steps to reproduce

  1. open https://jsfiddle.net/4jvtch20/
  2. click "Save" - an error is added to each field (expected/correct)
  3. click "Email" field input, once you focus out of the field, the error for this field is removed
  4. click "Dropdown" field input, no click in/out or value change does remove the field error

Expected result

With 'on': 'blur' I would expect consistent behaviour, ie. error similarly removed for dropdown as for standard input.

Version

2.9.2 / latest

@mvorisek mvorisek added state/awaiting-investigation Anything which needs more investigation state/awaiting-triage Any issues or pull requests which haven't yet been triaged type/bug Any issue which is a bug or PR which fixes a bug labels May 22, 2023
@mvorisek
Copy link
Contributor Author

@lubber-de shouldn't the dropdown emit blur event as other fields normally does?

@lubber-de
Copy link
Member

@lubber-de shouldn't the dropdown emit blur event as other fields normally does?

Given your example, the dropdown does not have a validation rule set. And it also does not have a native (non-hidden, non-search) input field to be validated automatically. Thats, why the validator does completely ignore blurring the dropdown.

I'll try to fetch this situation

@lubber-de lubber-de removed the state/awaiting-triage Any issues or pull requests which haven't yet been triaged label May 31, 2023
@mvorisek
Copy link
Contributor Author

In atk4/ui#2052 the issue is described a little better.

We set on: 'blur' https://github.com/atk4/ui/blob/4.0.0/src/Form.php#L554 which validates the whole form on blur. For inputs the validation works, but for dropdown it does not.

Currently, custom JS to remove validation errors manually is needed - https://github.com/atk4/ui/pull/2052/files . It works, but I would be happy if this could be addressed in Fomantic UI directly as both components (input, dropdown) are standard Fomantic UI ones.

@lubber-de
Copy link
Member

Fixed by #3129
See your adjusted jsfiddle here https://jsfiddle.net/lubber/tmhrgz41/1/

@lubber-de lubber-de added state/has-pr An issue which has a related PR open and removed state/awaiting-investigation Anything which needs more investigation labels Nov 24, 2024
@lubber-de lubber-de added this to the 2.9.4 milestone Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state/has-pr An issue which has a related PR open type/bug Any issue which is a bug or PR which fixes a bug
Projects
None yet
Development

No branches or pull requests

2 participants