Skip to content

Commit

Permalink
ensure we handle static panels
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinMalfait committed Sep 15, 2022
1 parent e1f3ef8 commit a5d9b0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/@headlessui-react/src/components/tabs/tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ let Panel = forwardRefWithAs(function Panel<TTag extends ElementType = typeof DE
tabIndex: selected ? 0 : -1,
}

if (!selected && (props.unmount ?? true)) {
if (!selected && (props.unmount ?? true) && !(props.static ?? false)) {
return <Hidden as="span" {...ourProps} />
}

Expand Down
2 changes: 1 addition & 1 deletion packages/@headlessui-vue/src/components/tabs/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ export let TabPanel = defineComponent({
tabIndex: selected.value ? 0 : -1,
}

if (!selected.value && props.unmount) {
if (!selected.value && props.unmount && !props.static) {
return h(Hidden, { as: 'span', ...ourProps })
}

Expand Down

0 comments on commit a5d9b0b

Please sign in to comment.