mirror of
https://github.com/TriliumNext/Trilium.git
synced 2025-12-11 19:44:00 -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);
|
setIsCreatingNewColumn(true);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const keydownCallback = useCallback((e: KeyboardEvent) => {
|
||||||
|
if (e.key === "Enter") {
|
||||||
|
setIsCreatingNewColumn(true);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`board-add-column ${isCreatingNewColumn ? "editing" : ""}`} onClick={addColumnCallback}>
|
<div
|
||||||
|
className={`board-add-column ${isCreatingNewColumn ? "editing" : ""}`}
|
||||||
|
onClick={addColumnCallback}
|
||||||
|
onKeyDown={keydownCallback}
|
||||||
|
tabIndex={300}
|
||||||
|
>
|
||||||
{!isCreatingNewColumn
|
{!isCreatingNewColumn
|
||||||
? <>
|
? <>
|
||||||
<Icon icon="bx bx-plus" />{" "}
|
<Icon icon="bx bx-plus" />{" "}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user