fix: ignore composing key events to prevent unintended behavior #1059
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.
Proposed changes
This change fixes an issue where history navigation (up/down arrow key on chat box) was accidentally triggered during IME composition.
Types of changes
What types of changes does your code introduce to 7TV?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
IME is a tool for writing Japanese (and other languages I'm not aware of) where users can select the word they want to enter from the list of words that match the pronounciation given by the user's keystrokes--this process is called composition.
It's pretty common to press arrow key during composition, and that has caused unintended chat history rewinding:
Opens up IME
![Screenshot 2024-08-07 at 12 13 07](https://private-user-images.githubusercontent.com/55415600/355662238-51e5a835-2c8b-4218-9aae-8d357612f4dc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5ODAzODcsIm5iZiI6MTcyNTk4MDA4NywicGF0aCI6Ii81NTQxNTYwMC8zNTU2NjIyMzgtNTFlNWE4MzUtMmM4Yi00MjE4LTlhYWUtOGQzNTc2MTJmNGRjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEwVDE0NTQ0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU5ZWVkYWE2MmJhNmJhMzIxOGNkMmM2NzQxYWYwMGVkYmZkZmQzZjI3NzdiNDJmZDY1Nzg3YTU0ZWQwNDVmYzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.hOzBsunSMHdevXlkd1sKVNQEBa7RY2dOJYvZRHNmCHE)
After pressing UP
![Screenshot 2024-08-07 at 12 13 34](https://private-user-images.githubusercontent.com/55415600/355662326-fc7d82fc-b889-4c56-aebf-59fd7d8cac7f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5ODAzODcsIm5iZiI6MTcyNTk4MDA4NywicGF0aCI6Ii81NTQxNTYwMC8zNTU2NjIzMjYtZmM3ZDgyZmMtYjg4OS00YzU2LWFlYmYtNTlmZDdkOGNhYzdmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEwVDE0NTQ0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY1MjZmMzMwZmEzZGU0OTA5ZGRmNmFmMjBlMzAyZWFiZmM2OTVhY2FkMGFlNmI0YzAxMTYyNDlkYjI2MjlhYzImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.lsTiLQ1O-eNNhfPD2O3H_cX690xn6vUsfCgK_T9ts4U)