-
-
Notifications
You must be signed in to change notification settings - Fork 845
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
text: Dispatch events on pasting text #19665
Merged
Merged
Conversation
This file contains 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
Lord-McSweeney
approved these changes
Mar 2, 2025
This aligns with how restrict behaves in Flash Player, as textInput events are fired before restrict.
This condition doesn't seem right, control characters should be filtered out by the frontend (and ideally the OS).
This refactor makes it possible to input text with more than one characters, which aligns with how pasting and IME works in Flash Player.
Flash Player dispatches textInput events with the original value, and only then filters using the restrict mechanism.
In FP, pasting text behaves the same way as inputting all the characters at once, it fires textInput events the same way, resticts works the same way, etc.
This test verifies events fired when pasting text.
This test verifies how pasting works when maxChars is present.
This test verifies how pasting works with restrict.
This test verifies various events fired when restrict on a field is active.
46a81ef
to
61d4334
Compare
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.
This PR includes refactors and fixes that make our implementation closer to FP:
textInput
,textInput
.Tests are included.
This refactor brings us closer to supporting IME, as IME works similarly to pasting.