Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(board): escape not working in "Add column"
Elian Dorana8992d08b38f
diff --git a/apps/client/src/widgets/collections/board/index.tsx b/apps/client/src/widgets/collections/board/index.tsxindex 519e1103cf..811ae5d18e 100644--- a/apps/client/src/widgets/collections/board/index.tsx+++ b/apps/client/src/widgets/collections/board/index.tsx@@ -243,7 +243,7 @@ export function TitleEditor({ currentValue, placeholder, save, dismiss, mode, isconst shouldDismiss = useRef(false);useEffect(() => {- focusElRef.current = document.activeElement;+ focusElRef.current = document.activeElement !== document.body ? document.activeElement : null;inputRef.current?.focus();inputRef.current?.select();}, [ inputRef ]);@@ -259,9 +259,11 @@ export function TitleEditor({ currentValue, placeholder, save, dismiss, mode, isif (e.key === "Enter" || e.key === "Escape") {e.preventDefault();e.stopPropagation();- shouldDismiss.current = (e.key === "Escape");if (focusElRef.current instanceof HTMLElement) {+ shouldDismiss.current = (e.key === "Escape");focusElRef.current.focus();+ } else {+ dismiss();}}};