mirror of
https://github.com/TriliumNext/Trilium.git
synced 2025-12-10 03:53:37 -06:00
feat(board): add keyboard navigation for "Add column" button
This commit is contained in:
parent
fd6ad6dce3
commit
b4ab07bd78
@ -204,8 +204,19 @@ function AddNewColumn({ api, isInRelationMode }: { api: BoardApi, isInRelationMo
|
||||
setIsCreatingNewColumn(true);
|
||||
}, []);
|
||||
|
||||
const keydownCallback = useCallback((e: KeyboardEvent) => {
|
||||
if (e.key === "Enter") {
|
||||
setIsCreatingNewColumn(true);
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className={`board-add-column ${isCreatingNewColumn ? "editing" : ""}`} onClick={addColumnCallback}>
|
||||
<div
|
||||
className={`board-add-column ${isCreatingNewColumn ? "editing" : ""}`}
|
||||
onClick={addColumnCallback}
|
||||
onKeyDown={keydownCallback}
|
||||
tabIndex={300}
|
||||
>
|
||||
{!isCreatingNewColumn
|
||||
? <>
|
||||
<Icon icon="bx bx-plus" />{" "}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user