-
Notifications
You must be signed in to change notification settings - Fork 272
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
fix(ui5-input): call change before submit event #10613
base: main
Are you sure you want to change the base?
Conversation
typo in branch name but should be fine :D |
Wrong BehaviorThe current implementation will only fire the submit event on enter if the input has changed. Prevent SubmittingBy facilitating
So with the planned modification the order of things would be correct.
UI5 WC should stay in line with this native behavior. So I would suggest to trigger the submit event as first thing within the |
this._enterKeyDown = true; | ||
|
||
if (isValueChanged && this._internals.form) { | ||
submitForm(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? This prevents firing of the change event. Defeats the purpose of the issu.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change should be fired if the value is changed since last (final) user interaction. As final user interaction (change event) is considered pressing Enter or focus out + value is changes since last focusin. Submit event should fire always when an Enter key is pressed (as in the native input)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh, ok got it now.
The variable name is simply wrong. Should be "isValueUnchanged" or something...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then again, looking at the implementation of _handleEnter
: You also have logic for selecting suggestion items via "Enter".
Wouldn't that also (falsely) trigger the submit?
FIXES: #10534