fix(keyboard): fix fireInputEventIfNeeded (#583) #607
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What: #583
When a text input with a single character value is selected, typing text
which starts with the same character results in the first character of
the typed text not to be typed.
This occurs as fireInputEventIfNeeded does not fire an input event due
to the new value matching the previous value of the input. The next
character is then typed and the selected text is then overwritten.
This fix changes the fireInputEventIfNeeded condition from no event
being fired when the previous and new values match to an event being
fired in this scenario when the element value has a selection.
Why:
To support the scenario in #583 to match expected events.
How:
The sandbox shows that the scenario outlined in the issue and test
should fire an input event which leads to the selection being
replaced so that the remainder of the text can be typed. This
change adds that input event to be fired and does not impact any
of the existing tests or snapshots.
Checklist: