Fix Ctrl+Enter to commit text (#675)

This commit is contained in:
0HyperCube 2022-06-11 12:01:31 +01:00 committed by Keavon Chambers
parent 3a30cdbb70
commit faecef40af

View file

@ -79,7 +79,7 @@ export function createInputManager(editor: Editor, container: HTMLElement, dialo
if (e.ctrlKey && e.shiftKey && key === "j") return false;
// Don't redirect tab or enter if not in canvas (to allow navigating elements)
if (!canvasFocused && ["tab", "enter", " ", "arrowdown", "arrowup", "arrowleft", "arrowright"].includes(key.toLowerCase())) return false;
if (!canvasFocused && !targetIsTextField(e.target) && ["tab", "enter", " ", "arrowdown", "arrowup", "arrowleft", "arrowright"].includes(key.toLowerCase())) return false;
// Redirect to the backend
return true;