Skip to content

Commit b346736

Browse files
authored
Ensure we handle the static prop in Tab.Panel components correctly (#1856)
* ensure we handle `static` panels * update changelog
1 parent e1f3ef8 commit b346736

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

packages/@headlessui-react/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Fixed
1111

1212
- Prevent option selection in `Combobox.Input` while composing ([#1850](https://github.com/tailwindlabs/headlessui/issues/1850))
13+
- Ensure we handle the `static` prop in `Tab.Panel` components correctly ([#1856](https://github.com/tailwindlabs/headlessui/pull/1856))
1314

1415
## [1.7.1] - 2022-09-12
1516

packages/@headlessui-react/src/components/tabs/tabs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ let Panel = forwardRefWithAs(function Panel<TTag extends ElementType = typeof DE
502502
tabIndex: selected ? 0 : -1,
503503
}
504504

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

packages/@headlessui-vue/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Fixed
1111

1212
- Prevent option selection in `ComboboxInput` while composing ([#1850](https://github.com/tailwindlabs/headlessui/issues/1850))
13+
- Ensure we handle the `static` prop in `TabPanel` components correctly ([#1856](https://github.com/tailwindlabs/headlessui/pull/1856))
1314

1415
## [1.7.1] - 2022-09-12
1516

packages/@headlessui-vue/src/components/tabs/tabs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ export let TabPanel = defineComponent({
395395
tabIndex: selected.value ? 0 : -1,
396396
}
397397

398-
if (!selected.value && props.unmount) {
398+
if (!selected.value && props.unmount && !props.static) {
399399
return h(Hidden, { as: 'span', ...ourProps })
400400
}
401401

0 commit comments

Comments
 (0)