Prevent Esc from closing editor during composition (#4738) * fix(IME): Prevent Esc from closing editor during composition When using a Chinese IME, pressing the Escape key during composition should cancel the composition, not close the message editor. This commit fixes the issue by adding a check for `!e.isComposing` to the 'keyup' event listener for the Escape key in `public/script.js`. This ensures that the editor is only closed when the Escape key is pressed outside of an IME composition session. * fix(IME): Change the handler of 'Escape' from 'keyup' to 'keydown' --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Signed| @@ -11374,8 +11374,8 @@ jQuery(async function () { | ||
| 11374 | 11374 | } |
| 11375 | 11375 | }); |
| 11376 | 11376 | |
| 11377 | 11377 | $(document).on('keyupkeydown', function (e) { |
| 11378 | 11378 | if (e.key === 'Escape' && !e.isComposing) { |
| 11379 | 11379 | const isEditVisible = $('#curEditTextarea').is(':visible') || $('.reasoning_edit_textarea').length > 0; |
| 11380 | 11380 | if (isEditVisible && power_user.auto_save_msg_edits === false) { |
| 11381 | 11381 | closeMessageEditor('all'); |