mirror of
https://github.com/open-webui/open-webui
synced 2025-01-29 13:58:09 +00:00
refac: message new line issue
This commit is contained in:
parent
d993beb18f
commit
ef4af86883
@ -817,7 +817,10 @@
|
||||
? $i18n.t('Listening...')
|
||||
: $i18n.t('Send a Message')}
|
||||
bind:value={prompt}
|
||||
on:keypress={(e) => {
|
||||
on:keypress={(e) => {}}
|
||||
on:keydown={async (e) => {
|
||||
// Check if the device is not a mobile device or if it is a mobile device, check if it is not a touch device
|
||||
// This is to prevent the Enter key from submitting the prompt on mobile devices
|
||||
if (
|
||||
!$mobile ||
|
||||
!(
|
||||
@ -826,15 +829,22 @@
|
||||
navigator.msMaxTouchPoints > 0
|
||||
)
|
||||
) {
|
||||
if (e.keyCode == 13 && !e.shiftKey) {
|
||||
// Check if Enter is pressed
|
||||
// Check if Shift key is not pressed
|
||||
if (e.key === 'Enter' && !e.shiftKey) {
|
||||
e.preventDefault();
|
||||
}
|
||||
if (prompt !== '' && e.keyCode == 13 && !e.shiftKey) {
|
||||
|
||||
if (e.key === 'Enter' && !e.shiftKey && prompt !== '') {
|
||||
submitPrompt(prompt, user);
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.key === 'Enter' && e.shiftKey && prompt !== '') {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}}
|
||||
on:keydown={async (e) => {
|
||||
|
||||
const isCtrlPressed = e.ctrlKey || e.metaKey; // metaKey is for Cmd key on Mac
|
||||
|
||||
// Check if Ctrl + R is pressed
|
||||
|
Loading…
Reference in New Issue
Block a user