-
I have a data table that contains a toggle. I want to click the row and be able to toggle the toggle. <DataTable
zebra
headers={school_headers}
rows={school_rows}
class="selectable-table"
on:click={goto_school}
>
<Toolbar>
<ToolbarSearch persistent shouldFilterRows bind:filteredRowIds />
</Toolbar>
<svelte:fragment slot="cell" let:cell let:row>
{#if cell.key === 'status'}
<Toggle
hideLabel
labelA=""
labelB=""
toggled={cell.value === 'ACTIVE'}
/>
{:else}
{cell.value}
{/if}
</svelte:fragment>
</DataTable> |
Beta Was this translation helpful? Give feedback.
Answered by
metonym
Jan 1, 2023
Replies: 1 comment 1 reply
-
Try stopping the click event propagation on the <Toggle
+ on:click={(e) => e.stopPropagation()}
hideLabel
labelA=""
labelB=""
toggled={cell.value === "ACTIVE"}
/> |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
omar2205
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try stopping the click event propagation on the
Toggle
.<Toggle + on:click={(e) => e.stopPropagation()} hideLabel labelA="" labelB="" toggled={cell.value === "ACTIVE"} />