Autocomplete: Fix unexpected block insertion during IME composition#45510
Conversation
|
|
|
Size Change: -1 B (0%) Total Size: 1.28 MB
ℹ️ View Unchanged
|
|
@ellatrix I think this issue should also be checked for other components refactored into |
|
Thank you @t-hamano for investigating and working on a fix!
That's definitely a possibility — would you actually have time to investigate those components, since you are very familiar with the issue and how to reproduce it? Thank you! 🙏 |
|
@ciampo |
|
@t-hamano Thank you so much for flagging! I'll also add Modal to the list of confirmed affected components — if there's some kind of text input in the modal and somebody hits Esc to escape out of IME composition, the modal will close. Could you fix that too, if you're addressing them all together? 🙏 I fear that this will become a common pitfall as people start switching from 📌 In short: When listening to key events that potentially fire from text inputs, |
Oh, it wasn't just the Enter key that should be considered. I would like to address them as well 👍 |
Fix: #45496
Please refer to the issue for details and causes of this problem.
What?
This PR fixes a problem in inserting a block using the slash key, where the Enter key to confirm input causes an unexpected block to be inserted.
Why?
Details are given in the issue comments, but for example, in Japanese, we press the Enter key after selecting a character from the candidates to confirm the input.
In #43432,
event.keyCodewas replaced byevent.code. But I confirmedevent.codedetects the Enter key to confirm the input, resulting in the unintended insertion of a block.How?
I found that
event.keyis valid: any keystroke before the input is confirmed, including the Enter key, returns the stringProcess.Testing Instructions
This PR may be difficult to test because it requires Japanese input, see "Step-by-step reproduction instructions" in #45496.