From a5d9b0bde7f5b421d2181656aae8def360d5487e Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Thu, 15 Sep 2022 18:16:56 +0200 Subject: [PATCH 1/2] ensure we handle `static` panels --- packages/@headlessui-react/src/components/tabs/tabs.tsx | 2 +- packages/@headlessui-vue/src/components/tabs/tabs.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@headlessui-react/src/components/tabs/tabs.tsx b/packages/@headlessui-react/src/components/tabs/tabs.tsx index 7b8ec5f014..02f51d8420 100644 --- a/packages/@headlessui-react/src/components/tabs/tabs.tsx +++ b/packages/@headlessui-react/src/components/tabs/tabs.tsx @@ -502,7 +502,7 @@ let Panel = forwardRefWithAs(function Panel } diff --git a/packages/@headlessui-vue/src/components/tabs/tabs.ts b/packages/@headlessui-vue/src/components/tabs/tabs.ts index a60236b5a7..26a54da69a 100644 --- a/packages/@headlessui-vue/src/components/tabs/tabs.ts +++ b/packages/@headlessui-vue/src/components/tabs/tabs.ts @@ -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 }) } From 76447945ced046d6817ae3826e9188e6c36f5d5c Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Thu, 15 Sep 2022 18:18:56 +0200 Subject: [PATCH 2/2] update changelog --- packages/@headlessui-react/CHANGELOG.md | 1 + packages/@headlessui-vue/CHANGELOG.md | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/@headlessui-react/CHANGELOG.md b/packages/@headlessui-react/CHANGELOG.md index 2cc23ceaea..6ffe2943e4 100644 --- a/packages/@headlessui-react/CHANGELOG.md +++ b/packages/@headlessui-react/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Prevent option selection in `Combobox.Input` while composing ([#1850](https://github.com/tailwindlabs/headlessui/issues/1850)) +- Ensure we handle the `static` prop in `Tab.Panel` components correctly ([#1856](https://github.com/tailwindlabs/headlessui/pull/1856)) ## [1.7.1] - 2022-09-12 diff --git a/packages/@headlessui-vue/CHANGELOG.md b/packages/@headlessui-vue/CHANGELOG.md index 36802121aa..e4c391d492 100644 --- a/packages/@headlessui-vue/CHANGELOG.md +++ b/packages/@headlessui-vue/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Prevent option selection in `ComboboxInput` while composing ([#1850](https://github.com/tailwindlabs/headlessui/issues/1850)) +- Ensure we handle the `static` prop in `TabPanel` components correctly ([#1856](https://github.com/tailwindlabs/headlessui/pull/1856)) ## [1.7.1] - 2022-09-12