-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
ui: add input as event for text form field #18563
Conversation
onchange={{this.onChangeWithEvent}} | ||
onkeyup={{this.handleKeyUp}} | ||
{{on "input" this.onChangeWithEvent}} | ||
{{on "change" this.onChangeWithEvent}} |
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.
both of these other event listeners are redundant here, now that "input" has been added, right?
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.
From MDN:
The change event is fired for
<input>
,<select>
, and<textarea>
elements when the user modifies the element's value. Unlike the input event, the change event is not necessarily fired for each alteration to an element's value.
It looks like they are mostly interchangeable, and we should favor change
events because historically the input event isn't always implemented to spec.
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.
Yeah that's what I read from the docs, but when it was just on change
the model wasn't updating properly 🤔
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.
Thanks for catching this!
* add input as event for form field * fix event typo, lowercase u
* add input as event for form field * fix event typo, lowercase u
* add input as event for form field * fix event typo, lowercase u
* add input as event for form field * fix event typo, lowercase u
* add input as event for form field * fix event typo, lowercase u
* add input as event for form field * fix event typo, lowercase u
* add input as event for form field * fix event typo, lowercase u
While smoke testing the pki key workflow, I noticed the model name wasn't updating as the text changed in the input field.