Skip to content

Commit

Permalink
docs: fix: table page Click and double-click on row example
Browse files Browse the repository at this point in the history
  • Loading branch information
shinokada committed Jun 26, 2024
1 parent 1cc2df7 commit 6583693
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/routes/docs/components/table.md
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,7 @@ An example to use on:click (main row) and on:dblclick (expanded row)
let openRow
let details
let doubleClickModal = false
const toggleRow = (i) => {
openRow = openRow === i ? null : i
Expand All @@ -897,7 +898,10 @@ An example to use on:click (main row) and on:dblclick (expanded row)
<TableBodyCell>{item.price}</TableBodyCell>
</TableBodyRow>
{#if openRow === i}
<TableBodyRow on:dblclick={() => (details = item)}>
<TableBodyRow on:dblclick={() => {
doubleClickModal = true;
details = item;
}}>
<TableBodyCell colspan="4" class="p-0">
<div class="px-2 py-3" transition:slide={{ duration: 300, axis: 'y' }}>
<ImagePlaceholder />
Expand All @@ -908,7 +912,7 @@ An example to use on:click (main row) and on:dblclick (expanded row)
{/each}
</TableBody>
</Table>
<Modal title={details?.name} open={!!details} autoclose outsideclose>
<Modal title={details?.name} bind:open={doubleClickModal} autoclose outsideclose>
<ImagePlaceholder />
</Modal>
```
Expand Down

0 comments on commit 6583693

Please sign in to comment.