Allow bulk row deletion via keyboard even without a focused cell

This commit is contained in:
Andrew Kingston 2023-04-24 13:07:53 +01:00
parent 59a354e0c5
commit 726945ea61
1 changed files with 4 additions and 0 deletions

View File

@ -25,6 +25,10 @@
} else if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) { } else if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) {
e.preventDefault() e.preventDefault()
dispatch("add-row-inline") dispatch("add-row-inline")
} else if (e.key === "Delete" || e.key === "Backspace") {
if (Object.keys($selectedRows).length) {
dispatch("request-bulk-delete")
}
} }
return return
} }