This commit is contained in:
Timothy Jaeryang Baek committed 2026-07-07 01:00:35 -05:00
1 parent 1b9a346991
commit c156aea2ae
1 file changed
+11
@@ -132,6 +132,13 @@
: $t('chat.voiceModeOn')
);
function isMobileInput(): boolean {
return (
typeof window !== 'undefined' &&
window.matchMedia('(hover: none) and (pointer: coarse)').matches
);
}
// ── Lowlight setup ──────────────────────────────
const lowlight = createLowlight(all);
const _origHighlight = lowlight.highlight.bind(lowlight);
@@ -313,6 +320,7 @@
return true;
}
if (event.key === 'Enter') {
if (isMobileInput()) return false;
const item = currentItems[selectedIndex];
if (item && command) command(item);
return true;
@@ -477,6 +485,7 @@
return true;
}
if (event.key === 'Enter') {
if (isMobileInput()) return false;
const item = currentItems[selectedIndex];
if (item && command) command(item);
return true;
@@ -554,6 +563,8 @@
spellcheck: 'true'
},
handleKeyDown: (view, event) => {
if (event.key === 'Enter' && isMobileInput()) return false;
if (showSlashCommands) {
if (event.key === 'ArrowDown') {
event.preventDefault();