Use either backspace or delete for deleting components

This commit is contained in:
Andrew Kingston 2022-08-17 14:47:20 +01:00
parent 37f9e7ad1d
commit 536dc56946
2 changed files with 4 additions and 4 deletions

View File

@ -15,21 +15,21 @@
</div> </div>
<MenuItem <MenuItem
icon="Delete" icon="Delete"
keyBind="Del" keyBind="!BackAndroid"
on:click={() => keyboardEvent("Delete")} on:click={() => keyboardEvent("Delete")}
> >
Delete Delete
</MenuItem> </MenuItem>
<MenuItem <MenuItem
icon="ChevronUp" icon="ChevronUp"
keyBind="Ctrl+" keyBind="Ctrl+!ArrowUp"
on:click={() => keyboardEvent("ArrowUp", true)} on:click={() => keyboardEvent("ArrowUp", true)}
> >
Move up Move up
</MenuItem> </MenuItem>
<MenuItem <MenuItem
icon="ChevronDown" icon="ChevronDown"
keyBind="Ctrl+" keyBind="Ctrl+!ArrowDown"
on:click={() => keyboardEvent("ArrowDown", true)} on:click={() => keyboardEvent("ArrowDown", true)}
> >
Move down Move down

View File

@ -113,7 +113,7 @@
e.preventDefault() e.preventDefault()
$goto("./new") $goto("./new")
} }
} else if (e.key === "Delete") { } else if (e.key === "Backspace" || e.key === "Delete") {
// Don't show confirmation for the screen itself // Don't show confirmation for the screen itself
if (component._id === get(selectedScreen).props._id) { if (component._id === get(selectedScreen).props._id) {
return return