mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-14 13:25:20 +00:00
refac
This commit is contained in:
parent
ed926c8f26
commit
7670543a39
1 changed files with 26 additions and 2 deletions
|
|
@ -1130,7 +1130,20 @@
|
|||
return res;
|
||||
}}
|
||||
oncompositionstart={() => (isComposing = true)}
|
||||
oncompositionend={() => (isComposing = false)}
|
||||
oncompositionend={() => {
|
||||
const isSafari = /^((?!chrome|android).)*safari/i.test(
|
||||
navigator.userAgent
|
||||
);
|
||||
|
||||
if (isSafari) {
|
||||
// Safari has a bug where compositionend is not triggered correctly #16615
|
||||
// when using the virtual keyboard on iOS.
|
||||
// We use a timeout to ensure that the composition is ended after a short delay.
|
||||
setTimeout(() => (isComposing = false));
|
||||
} else {
|
||||
isComposing = false;
|
||||
}
|
||||
}}
|
||||
on:keydown={async (e) => {
|
||||
e = e.detail.event;
|
||||
|
||||
|
|
@ -1341,7 +1354,18 @@
|
|||
command = getCommand();
|
||||
}}
|
||||
on:compositionstart={() => (isComposing = true)}
|
||||
on:compositionend={() => setTimeout(() => (isComposing = false))}
|
||||
on:compositionend={() => {
|
||||
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
||||
|
||||
if (isSafari) {
|
||||
// Safari has a bug where compositionend is not triggered correctly #16615
|
||||
// when using the virtual keyboard on iOS.
|
||||
// We use a timeout to ensure that the composition is ended after a short delay.
|
||||
setTimeout(() => (isComposing = false));
|
||||
} else {
|
||||
isComposing = false;
|
||||
}
|
||||
}}
|
||||
on:keydown={async (e) => {
|
||||
const isCtrlPressed = e.ctrlKey || e.metaKey; // metaKey is for Cmd key on Mac
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue