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:
commit
08c8ba8d81
|
@ -28,7 +28,7 @@
|
||||||
export let rowCount = 0
|
export let rowCount = 0
|
||||||
export let quiet = false
|
export let quiet = false
|
||||||
export let loading = false
|
export let loading = false
|
||||||
export let allowSelectRows = true
|
export let allowSelectRows
|
||||||
export let allowEditRows = true
|
export let allowEditRows = true
|
||||||
export let allowEditColumns = true
|
export let allowEditColumns = true
|
||||||
export let selectedRows = []
|
export let selectedRows = []
|
||||||
|
@ -344,11 +344,7 @@
|
||||||
{/if}
|
{/if}
|
||||||
{#if sortedRows?.length}
|
{#if sortedRows?.length}
|
||||||
{#each sortedRows as row, idx}
|
{#each sortedRows as row, idx}
|
||||||
<div
|
<div class="spectrum-Table-row">
|
||||||
class="spectrum-Table-row"
|
|
||||||
on:click={() => dispatch("click", row)}
|
|
||||||
on:click={() => toggleSelectRow(row)}
|
|
||||||
>
|
|
||||||
{#if showEditColumn}
|
{#if showEditColumn}
|
||||||
<div
|
<div
|
||||||
class="spectrum-Table-cell spectrum-Table-cell--divider spectrum-Table-cell--edit"
|
class="spectrum-Table-cell spectrum-Table-cell--divider spectrum-Table-cell--edit"
|
||||||
|
@ -373,6 +369,12 @@
|
||||||
class="spectrum-Table-cell"
|
class="spectrum-Table-cell"
|
||||||
class:spectrum-Table-cell--divider={!!schema[field].divider}
|
class:spectrum-Table-cell--divider={!!schema[field].divider}
|
||||||
style={cellStyles[field]}
|
style={cellStyles[field]}
|
||||||
|
on:click={() => {
|
||||||
|
if (!schema[field]?.preventSelectRow) {
|
||||||
|
dispatch("click", row)
|
||||||
|
toggleSelectRow(row)
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<CellRenderer
|
<CellRenderer
|
||||||
{customRenderers}
|
{customRenderers}
|
||||||
|
|
|
@ -86,6 +86,7 @@
|
||||||
sortable: false,
|
sortable: false,
|
||||||
divider: true,
|
divider: true,
|
||||||
width: "auto",
|
width: "auto",
|
||||||
|
preventSelectRow: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue