-
Notifications
You must be signed in to change notification settings - Fork 29
Fix: dispatching change event after new value is set. #27
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: dispatching change event after new value is set. #27
Conversation
@@ -129,6 +129,8 @@ class TextExpander { | |||
|
|||
this.input.value = beginning + value + remaining | |||
|
|||
this.input.dispatchEvent(new Event('change', {bubbles: true})) |
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.
Can we please add a test that confirms this behaviour, that we can also use to validate and avoid regressions here.
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.
@keithamus , I don't have experience in testing. can you please help me out here?
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.
@keithamus, I have added some tests by looking at previous tests.
@keithamus , please review this PR. |
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.
Hey @Sachin-chaurasiya; the tests run fine for me when I remove the line that dispatches the change
event.
Maybe you can add motivation for this change to the PR and double-check that this change
event is being dispatched already by the browser.
@@ -129,6 +129,8 @@ class TextExpander { | |||
|
|||
this.input.value = beginning + value + remaining | |||
|
|||
this.input.dispatchEvent(new Event('change', {bubbles: true})) |
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.
The tests run green for me with this line removed so either the tests are wrong or the implementation.
Closing this PR as an Issue is different. |
@keithamus, Please review the PR.