diff options
| author | Ellie Huxtable <ellie@atuin.sh> | 2024-07-25 16:23:56 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-25 16:23:56 +0100 |
| commit | 74d084305c50219bcaa9ff474fc2a1727b4e4a69 (patch) | |
| tree | e0baea3a94c046bd2519707b03f2b609f60d6cf0 /ui/src | |
| parent | fix(gui): double return on mac/linux (#2311) (diff) | |
| download | atuin-74d084305c50219bcaa9ff474fc2a1727b4e4a69.zip | |
fix(gui): cursor positioning on new doc creation (#2310)
Diffstat (limited to 'ui/src')
| -rw-r--r-- | ui/src/components/runbooks/List.tsx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/src/components/runbooks/List.tsx b/ui/src/components/runbooks/List.tsx index 024bcfd1..d4591e6f 100644 --- a/ui/src/components/runbooks/List.tsx +++ b/ui/src/components/runbooks/List.tsx @@ -58,6 +58,9 @@ const NoteSidebar = () => { variant="light" size="sm" onPress={async () => { + // otherwise the cursor is weirdly positioned in the new document + window.getSelection()?.removeAllRanges(); + let runbook = await Runbook.create(); setCurrentRunbook(runbook.id); refreshRunbooks(); @@ -105,6 +108,10 @@ const NoteSidebar = () => { className="text-danger" onPress={async () => { await Runbook.delete(runbook.id); + + if (runbook.id == currentRunbook) + setCurrentRunbook(null); + refreshRunbooks(); }} > |
