mirror of
https://github.com/zadam/trilium.git
synced 2025-11-16 13:34:30 +01:00
fix(board): escape not working in "Add column"
This commit is contained in:
parent
5e35aa8079
commit
a8992d08b3
@ -243,7 +243,7 @@ export function TitleEditor({ currentValue, placeholder, save, dismiss, mode, is
|
||||
const 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, is
|
||||
if (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();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user