mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-17 02:05:22 -04:00
fix(ui): Prevent Enter key from triggering submission on mobile devices (#3970)
- Add check for mobile screen width (<= 768px) to prevent accidental submissions via the Enter key. - Update event listeners in static/app.js and static/js/chat.js to respect this constraint.
This commit is contained in:
+3
-1
@@ -3868,7 +3868,9 @@ import { wireArrowUpRecall, getLastUserMessageFromChatHistory } from './composer
|
||||
|
||||
// Also submit on Enter (without shift)
|
||||
editor.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Enter' && !e.shiftKey && !e.isComposing) {
|
||||
const isMobile = window.innerWidth <= 768
|
||||
|
||||
if (e.key === 'Enter' && !e.shiftKey && !e.isComposing && !isMobile) {
|
||||
e.preventDefault();
|
||||
saveBtn.click();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user