diff --git a/.changeset/purple-grapes-compare.md b/.changeset/purple-grapes-compare.md new file mode 100644 index 000000000..a2c397ff2 --- /dev/null +++ b/.changeset/purple-grapes-compare.md @@ -0,0 +1,5 @@ +--- +"bits-ui": patch +--- + +fix: Changed svelte event handlers in favor of CustomEventHandler diff --git a/packages/bits-ui/src/lib/bits/combobox/types.ts b/packages/bits-ui/src/lib/bits/combobox/types.ts index 2be530b5b..fb20e61fb 100644 --- a/packages/bits-ui/src/lib/bits/combobox/types.ts +++ b/packages/bits-ui/src/lib/bits/combobox/types.ts @@ -1,4 +1,4 @@ -import type { EventHandler, HTMLInputAttributes, HTMLLabelAttributes } from "svelte/elements"; +import type { HTMLInputAttributes, HTMLLabelAttributes } from "svelte/elements"; import type { ComboboxOptionProps as MeltComboboxOptionProps, CreateComboboxProps as MeltComboboxProps, @@ -128,15 +128,15 @@ export type ComboboxArrowProps = ComboboxArrowPropsWithoutHTML & HTMLDivAttribut export type ComboboxItemEvents = { click: CustomEventHandler; pointermove: CustomEventHandler; - focusin: EventHandler; - keydown: EventHandler; - focusout: EventHandler; - pointerleave: EventHandler; + focusin: CustomEventHandler; + keydown: CustomEventHandler; + focusout: CustomEventHandler; + pointerleave: CustomEventHandler; }; export type ComboboxContentEvents = { pointerleave: CustomEventHandler; - keydown: EventHandler; + keydown: CustomEventHandler; }; export type ComboboxGroupLabelEvents = { diff --git a/packages/bits-ui/src/lib/bits/select/types.ts b/packages/bits-ui/src/lib/bits/select/types.ts index cf4fe7138..18ee0b997 100644 --- a/packages/bits-ui/src/lib/bits/select/types.ts +++ b/packages/bits-ui/src/lib/bits/select/types.ts @@ -1,9 +1,4 @@ -import type { - EventHandler, - HTMLAttributes, - HTMLButtonAttributes, - HTMLInputAttributes, -} from "svelte/elements"; +import type { HTMLAttributes, HTMLButtonAttributes, HTMLInputAttributes } from "svelte/elements"; import type { SelectOptionProps as MeltSelectOptionProps, CreateSelectProps as MeltSelectProps, @@ -124,10 +119,10 @@ export type SelectIndicatorProps = SelectIndicatorPropsWithoutHTML & HTMLDivAttr export type SelectItemEvents = { click: CustomEventHandler; pointermove: CustomEventHandler; - focusin: EventHandler; - keydown: EventHandler; - focusout: EventHandler; - pointerleave: EventHandler; + focusin: CustomEventHandler; + keydown: CustomEventHandler; + focusout: CustomEventHandler; + pointerleave: CustomEventHandler; }; export type SelectTriggerEvents = { @@ -140,5 +135,5 @@ export type SelectLabelEvents = { }; export type SelectContentEvents = { pointerleave: CustomEventHandler; - keydown: EventHandler; + keydown: CustomEventHandler; };