Fix keyboard shortcuts circumventing disabling adding rows
This commit is contained in:
parent
80da2fb93a
commit
96fc70f29a
|
@ -130,7 +130,9 @@
|
|||
<GridBody />
|
||||
</div>
|
||||
<BetaButton />
|
||||
<NewRow />
|
||||
{#if allowAddRows}
|
||||
<NewRow />
|
||||
{/if}
|
||||
<div class="overlays">
|
||||
<ResizeOverlay />
|
||||
<ReorderOverlay />
|
||||
|
|
|
@ -38,8 +38,10 @@
|
|||
e.preventDefault()
|
||||
focusFirstCell()
|
||||
} else if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) {
|
||||
e.preventDefault()
|
||||
dispatch("add-row-inline")
|
||||
if ($config.allowAddRows) {
|
||||
e.preventDefault()
|
||||
dispatch("add-row-inline")
|
||||
}
|
||||
} else if (e.key === "Delete" || e.key === "Backspace") {
|
||||
if (Object.keys($selectedRows).length && $config.allowDeleteRows) {
|
||||
dispatch("request-bulk-delete")
|
||||
|
@ -89,7 +91,9 @@
|
|||
}
|
||||
break
|
||||
case "Enter":
|
||||
dispatch("add-row-inline")
|
||||
if ($config.allowAddRows) {
|
||||
dispatch("add-row-inline")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
switch (e.key) {
|
||||
|
|
Loading…
Reference in New Issue