mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
fix(tabs): remove hidden attribute for selected tab panel
This commit is contained in:
parent
9ebf11dcfa
commit
a0b6b561af
1 changed files with 6 additions and 2 deletions
|
@ -7,16 +7,20 @@
|
||||||
|
|
||||||
import { getContext } from "svelte";
|
import { getContext } from "svelte";
|
||||||
|
|
||||||
const { selectedContent, addContent } = getContext("Tabs");
|
const { selectedContent, addContent, tabs, contentById } = getContext("Tabs");
|
||||||
|
|
||||||
addContent({ id });
|
addContent({ id });
|
||||||
|
|
||||||
$: selected = $selectedContent === id;
|
$: selected = $selectedContent === id;
|
||||||
|
$: index = $contentById[id].index;
|
||||||
|
$: tabId = $tabs[index].id;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
role="tabpanel"
|
||||||
|
aria-labelledby={tabId}
|
||||||
aria-hidden={!selected}
|
aria-hidden={!selected}
|
||||||
hidden={!selected}
|
hidden={selected ? undefined : ''}
|
||||||
{id}
|
{id}
|
||||||
class:bx--tab-content={true}
|
class:bx--tab-content={true}
|
||||||
{...$$restProps}>
|
{...$$restProps}>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue