aboutsummaryrefslogtreecommitdiffstats
path: root/ui/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/components')
-rw-r--r--ui/src/components/runbooks/List.tsx7
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();
}}
>