Merge pull request #6220 from Budibase/bug/sev3/select-row-with-button

Don't allow row selection for buttons in rows
This commit is contained in:
melohagan 2022-06-08 09:18:01 +01:00 committed by GitHub
commit 9898bf4116
2 changed files with 9 additions and 6 deletions

View File

@ -28,7 +28,7 @@
export let rowCount = 0
export let quiet = false
export let loading = false
export let allowSelectRows = true
export let allowSelectRows
export let allowEditRows = true
export let allowEditColumns = true
export let selectedRows = []
@ -344,11 +344,7 @@
{/if}
{#if sortedRows?.length}
{#each sortedRows as row, idx}
<div
class="spectrum-Table-row"
on:click={() => dispatch("click", row)}
on:click={() => toggleSelectRow(row)}
>
<div class="spectrum-Table-row">
{#if showEditColumn}
<div
class="spectrum-Table-cell spectrum-Table-cell--divider spectrum-Table-cell--edit"
@ -373,6 +369,12 @@
class="spectrum-Table-cell"
class:spectrum-Table-cell--divider={!!schema[field].divider}
style={cellStyles[field]}
on:click={() => {
if (!schema[field]?.preventSelectRow) {
dispatch("click", row)
toggleSelectRow(row)
}
}}
>
<CellRenderer
{customRenderers}

View File

@ -86,6 +86,7 @@
sortable: false,
divider: true,
width: "auto",
preventSelectRow: true,
}
}