Add focus document toggle (#3672)

This commit is contained in:
Timon
2026-01-23 15:28:02 +00:00
committed by GitHub
parent 2be7790d4d
commit 7a5790744f
7 changed files with 149 additions and 58 deletions
+7 -1
View File
@@ -93,7 +93,13 @@ export function createInputManager(editor: Editor, dialog: DialogState, portfoli
// Don't redirect tab or enter if not in canvas (to allow navigating elements)
potentiallyRestoreCanvasFocus(e);
if (!canvasFocused && !targetIsTextField(e.target || undefined) && ["Tab", "Enter", "NumpadEnter", "Space", "ArrowDown", "ArrowLeft", "ArrowRight", "ArrowUp"].includes(key)) return false;
if (
!canvasFocused &&
!targetIsTextField(e.target || undefined) &&
["Tab", "Enter", "NumpadEnter", "Space", "ArrowDown", "ArrowLeft", "ArrowRight", "ArrowUp"].includes(key) &&
!(e.ctrlKey || e.metaKey || e.altKey)
)
return false;
// Don't redirect if a MenuList is open
if (window.document.querySelector("[data-floating-menu-content]")) return false;