mirror of
https://github.com/atuinsh/atuin.git
synced 2024-11-21 15:53:30 +01:00
fix(gui): cursor positioning on new doc creation (#2310)
This commit is contained in:
parent
c408465549
commit
74d084305c
@ -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();
|
||||
}}
|
||||
>
|
||||
|
Loading…
Reference in New Issue
Block a user