Skip to content

Commit

Permalink
Change default tags for ListboxOptions, ListboxOption, `ComboboxO…
Browse files Browse the repository at this point in the history
…ptions`, `ComboboxOption` and `TabGroup` components (#3109)

* use `div` as default tag for `ListboxOptions` and `ListboxOption` components

* use `div` as default tag for `ComboboxOptions` and `ComboboxOption` components

* use `div` as default tag for `TabGroup`

* update changelog
  • Loading branch information
RobinMalfait authored Apr 18, 2024
1 parent 9f44656 commit 83cda0a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/@headlessui-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Deprecate the `entered` prop on the `Transition` component ([#3089](https://github.com/tailwindlabs/headlessui/pull/3089))
- Use native `useId` and `useSyncExternalStore` hooks ([#3092](https://github.com/tailwindlabs/headlessui/pull/3092))
- Use `absolute` as the default Floating UI strategy ([#3097](https://github.com/tailwindlabs/headlessui/pull/3097))
- Change default tags for `ListboxOptions`, `ListboxOption`, `ComboboxOptions`, `ComboboxOption` and `TabGroup` components ([#3109](https://github.com/tailwindlabs/headlessui/pull/3109))

### Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ function ButtonFn<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG>(

// ---

let DEFAULT_OPTIONS_TAG = 'ul' as const
let DEFAULT_OPTIONS_TAG = 'div' as const
type OptionsRenderPropArg = {
open: boolean
option: unknown
Expand Down Expand Up @@ -1630,7 +1630,7 @@ function OptionsFn<TTag extends ElementType = typeof DEFAULT_OPTIONS_TAG>(

// ---

let DEFAULT_OPTION_TAG = 'li' as const
let DEFAULT_OPTION_TAG = 'div' as const
type OptionRenderPropArg = {
focus: boolean
/** @deprecated use `focus` instead */
Expand Down
4 changes: 2 additions & 2 deletions packages/@headlessui-react/src/components/listbox/listbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ function ButtonFn<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG>(

let SelectedOptionContext = createContext(false)

let DEFAULT_OPTIONS_TAG = 'ul' as const
let DEFAULT_OPTIONS_TAG = 'div' as const
type OptionsRenderPropArg = {
open: boolean
}
Expand Down Expand Up @@ -1100,7 +1100,7 @@ function OptionsFn<TTag extends ElementType = typeof DEFAULT_OPTIONS_TAG>(

// ---

let DEFAULT_OPTION_TAG = 'li' as const
let DEFAULT_OPTION_TAG = 'div' as const
type OptionRenderPropArg = {
/** @deprecated use `focus` instead */
active: boolean
Expand Down
3 changes: 1 addition & 2 deletions packages/@headlessui-react/src/components/tabs/tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { useFocusRing } from '@react-aria/focus'
import { useHover } from '@react-aria/interactions'
import React, {
Fragment,
createContext,
useContext,
useMemo,
Expand Down Expand Up @@ -220,7 +219,7 @@ function stateReducer(state: StateDefinition, action: Actions) {

// ---

let DEFAULT_TABS_TAG = Fragment
let DEFAULT_TABS_TAG = 'div' as const
type TabsRenderPropArg = {
selectedIndex: number
}
Expand Down

0 comments on commit 83cda0a

Please sign in to comment.