Repository navigation
fix(input, textarea): clearOnInput ignores key modifiers - #28639
Merged
Merged
Conversation
liamdebeasi
commented
Dec 5, 2023
Contributor
Author
|
Reviewers: This task was completed outside of my sprint work, so sprint work-related PRs take higher priority. |
liamdebeasi
commented
Dec 5, 2023
|
|
||
| test('should not clear when enter is pressed', async ({ page }) => { | ||
| await page.setContent(`<ion-input value="abc" clear-on-edit="true" aria-label="input"></ion-input>`, config); | ||
| test('should not clear the input if it does not have an initial value when typing', async ({ page }) => { |
Contributor
Author
There was a problem hiding this comment.
This new test (and the same textarea test) was copied over from the legacy directory. I accidentally regressed a behavior that only the legacy tests caught. Since the behavior is still relevant for the modern form control syntax, I decided to copy them over so we don't lose test coverage when we remove the legacy form syntax.
thetaPC
reviewed
Dec 6, 2023
thetaPC
left a comment
Contributor
There was a problem hiding this comment.
Works as intended! Just one comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue number: resolves #28633
What is the current behavior?
In #28005 I introduced a fix that causes "clearOnEdit" to not clear input/textarea when the Tab key was pressed. However, there were several edge cases I missed. For instance, pressing the "shift" key and then the "tab" key would still clear the input because "shift" was not explicitly excluded.
What is the new behavior?
didInputClearOnEditis not set totruewhen an ignored key is pressed. Otherwise, pressing an ignored key and then an accepted key would not cause the input to be cleared. For example, pressing "shift", releasing "shift", then pressing "A" should cause the input to still get cleared.Does this introduce a breaking change?
Other information
Playwright bug report for a9f34a5: microsoft/playwright#28495