Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/@headlessui-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Ensure we are not freezing data when the `static` prop is used ([#3779](https://github.com/tailwindlabs/headlessui/pull/3779))
- Ensure `onChange` types are contravariant instead of bivariant ([#3781](https://github.com/tailwindlabs/headlessui/pull/3781))

## [2.2.7] - 2025-07-30

Expand Down
10 changes: 5 additions & 5 deletions packages/@headlessui-react/src/components/combobox/combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ export type ComboboxProps<
value?: TMultiple extends true ? EnsureArray<TValue> : TValue
defaultValue?: TMultiple extends true ? EnsureArray<NoInfer<TValue>> : NoInfer<TValue>

onChange?(
onChange?: (
value: TMultiple extends true ? EnsureArray<NoInfer<TValue>> : NoInfer<TValue> | null
): void
) => void
by?: ByComparator<
TMultiple extends true ? EnsureArray<NoInfer<TValue>>[number] : NoInfer<TValue>
>
Expand All @@ -279,7 +279,7 @@ export type ComboboxProps<
) => boolean
} | null

onClose?(): void
onClose?: () => void
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary in this case, but more consistent


__demoMode?: boolean
}
Expand Down Expand Up @@ -513,8 +513,8 @@ export type ComboboxInputProps<
{
defaultValue?: TType
disabled?: boolean
displayValue?(item: TType): string
onChange?(event: React.ChangeEvent<HTMLInputElement>): void
displayValue?: (item: TType) => string
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void
autoFocus?: boolean
}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export type ListboxProps<
{
value?: TType
defaultValue?: TType
onChange?(value: TType): void
onChange?: (value: TType) => void
by?: ByComparator<TActualType>
disabled?: boolean
invalid?: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export type RadioGroupProps<
{
value?: TType
defaultValue?: TType
onChange?(value: TType): void
onChange?: (value: TType) => void
by?: ByComparator<TType>
disabled?: boolean
form?: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export type SwitchProps<TTag extends ElementType = typeof DEFAULT_SWITCH_TAG> =
{
checked?: boolean
defaultChecked?: boolean
onChange?(checked: boolean): void
onChange?: (checked: boolean) => void
name?: string
value?: string
form?: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export interface Context<MetaType extends Record<string, any> = any> {
}

export interface ScrollLockStep<MetaType extends Record<string, any> = any> {
before?(ctx: Context<MetaType>): void
after?(ctx: Context<MetaType>): void
before?: (ctx: Context<MetaType>) => void
after?: (ctx: Context<MetaType>) => void
}

export let overflows = createStore(() => new Map<Document, DocEntry>(), {
Expand Down
4 changes: 2 additions & 2 deletions packages/@headlessui-react/src/hooks/use-transition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ export function useTransition(
element: HTMLElement | null,
show: boolean,
events?: {
start?(show: boolean): void
end?(show: boolean): void
start?: (show: boolean) => void
end?: (show: boolean) => void
}
): [visible: boolean, data: TransitionData] {
let [visible, setVisible] = useState(show)
Expand Down