mirror of
https://github.com/open-webui/computer.git
synced 2026-11-25 23:00:55 -05:00
refac
This commit is contained in:
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();
|
||||
|
||||
Reference in new issue
Block a user