fix: iframe text input (IME) - #28
Merged
Merged
Conversation
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.
Removes the input element filtering for IME state changes that was added in #25 .
Problem
In order to hide the system IME window when text elements are focused / unfocused, I had added javascript tracking for inputs and textarea focus events. However, that didn't work with iframes, which at least some Prisma UI mods are dependent on, resulting in text input not working (being filtered out) within iframes.
Changes
Removed the per-element focus tracking from the IME support. This reverts the behavior to be much closer to the 1.3 state, plus the json IME state event for custom UI mods to use.
This is a slight loss of behavior for IME input, as described in the following scenario, but not a big change.
Scenario: User unfocuses a text input (clicks a panel), then types, then refocuses the text input.
Before: IME state is reset automatically - no composition is shown in the text input (track when input was focused, clear state)
After: IME state is not reset. On re-focusing the text input, the IME state event shows the text that was typed while nothing was in focus.
This could be mitigated by providing an API to clear IME state, with the consumer mod calling it on-demand when their text elements gain/lose focus. But it seems pretty minor, not sure this is needed for now.
Testing done