Pressing Enter to confirm an IME composition (e.g. Japanese, Chinese, or Korean) in the chat search modal and the sidebar search input was treated as a normal Enter and triggered a search action such as starting a new chat, instead of just confirming the composed text. Guard the search keydown handlers so a keydown fired while composing is ignored: - SearchInput.svelte on:keydown - SearchModal.svelte document-level onKeyDown using e.isComposing (with a keyCode === 229 fallback), mirroring the IME guard already used by MessageInput. A second Enter, after the composition is confirmed, still triggers the action as before. Fixes #26172 Co-authored-by: Yogi <251807336+ybnjm1234-source@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2 files changed
+12
No files matched your search
@@ -176,6 +176,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const onKeyDown = (e) => {
|
const onKeyDown = (e) => {
|
||||||
|
// Ignore keydown fired while confirming an IME composition (e.g. Japanese/Chinese/Korean)
|
||||||
|
// so confirming the composition with Enter doesn't trigger search actions (#26172).
|
||||||
|
if (e.isComposing || e.keyCode === 229) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const searchOptions = document.getElementById('search-options-container');
|
const searchOptions = document.getElementById('search-options-container');
|
||||||
if (searchOptions || !show) {
|
if (searchOptions || !show) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -229,6 +229,12 @@
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
on:keydown={(e) => {
|
on:keydown={(e) => {
|
||||||
|
// Ignore keydown fired while confirming an IME composition (e.g. Japanese/Chinese/Korean)
|
||||||
|
// so confirming the composition with Enter doesn't trigger search actions (#26172).
|
||||||
|
if (e.isComposing || e.keyCode === 229) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (e.key === 'Enter') {
|
if (e.key === 'Enter') {
|
||||||
if (filteredItems.length > 0) {
|
if (filteredItems.length > 0) {
|
||||||
const itemElement = document.getElementById(`search-item-${selectedIdx}`);
|
const itemElement = document.getElementById(`search-item-${selectedIdx}`);
|
||||||
|
|||||||
Reference in new issue
Block a user