Browse Source
Merge pull request #6220 from Budibase/bug/sev3/select-row-with-button
Don't allow row selection for buttons in rows
master
melohagan
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
9 additions and
6 deletions
-
packages/bbui/src/Table/Table.svelte
-
packages/client/src/components/app/table/Table.svelte
|
|
|
@ -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} |
|
|
|
|
|
|
|
@ -86,6 +86,7 @@ |
|
|
|
sortable: false, |
|
|
|
divider: true, |
|
|
|
width: "auto", |
|
|
|
preventSelectRow: true, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|