Skip to content

Commit

Permalink
Bugfix/table cells interactive focusable (#2194)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmoud-zino authored Nov 7, 2023
1 parent 54c5fba commit a85483d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/rich-squids-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@skeletonlabs/skeleton": patch
---

bugfix: table cells are not focusable when `interactive` is not set.
8 changes: 4 additions & 4 deletions packages/skeleton/src/lib/components/Table/Table.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@
<table
class="{classesTable}"
class:table-interactive={interactive}
role="grid"
role={interactive ? "grid" : "table"}
use:tableA11y
>
<!-- on:keydown={(e) => onTableKeydown(elemTable, e)} -->
<!-- Head -->
<thead class="table-head {regionHead}">
<tr>
{#each source.head as heading }
<th class="{regionHeadCell}">{@html heading}</th>
<th class="{regionHeadCell}" role="columnheader">{@html heading}</th>
{/each}
</tr>
</thead>
Expand All @@ -95,9 +95,9 @@
<!-- prettier-ignore -->
<td
class="{regionCell}"
role="gridcell"
role={interactive ? "gridcell" : "cell"}
aria-colindex={cellIndex + 1}
tabindex={cellIndex === 0 ? 0 : -1}
tabindex={cellIndex === 0 && interactive ? 0 : -1}
>
{@html Number(cell) === 0 ? cell : (cell ? cell : '-')}
</td>
Expand Down

0 comments on commit a85483d

Please sign in to comment.