Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Changed svelte event handlers in favor of CustomEventHandler #536

Merged
merged 3 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 6 additions & 6 deletions packages/bits-ui/src/lib/bits/combobox/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { EventHandler, HTMLInputAttributes } from "svelte/elements";
import type { HTMLInputAttributes } from "svelte/elements";
import type {
ComboboxOptionProps as MeltComboboxOptionProps,
CreateComboboxProps as MeltComboboxProps,
Expand Down Expand Up @@ -128,15 +128,15 @@ export type ComboboxArrowProps = ComboboxArrowPropsWithoutHTML & HTMLDivAttribut
export type ComboboxItemEvents<T extends Element = HTMLDivElement> = {
click: CustomEventHandler<MouseEvent, T>;
pointermove: CustomEventHandler<PointerEvent, T>;
focusin: EventHandler<FocusEvent, T>;
keydown: EventHandler<KeyboardEvent, T>;
focusout: EventHandler<FocusEvent, T>;
pointerleave: EventHandler<PointerEvent, T>;
focusin: CustomEventHandler<FocusEvent, T>;
keydown: CustomEventHandler<KeyboardEvent, T>;
focusout: CustomEventHandler<FocusEvent, T>;
pointerleave: CustomEventHandler<PointerEvent, T>;
};

export type ComboboxContentEvents<T extends Element = HTMLDivElement> = {
pointerleave: CustomEventHandler<PointerEvent, T>;
keydown: EventHandler<KeyboardEvent, T>;
keydown: CustomEventHandler<KeyboardEvent, T>;
};

export type ComboboxGroupLabelEvents<T extends Element = HTMLSpanElement> = {
Expand Down
17 changes: 6 additions & 11 deletions packages/bits-ui/src/lib/bits/select/types.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -124,10 +119,10 @@ export type SelectIndicatorProps = SelectIndicatorPropsWithoutHTML & HTMLDivAttr
export type SelectItemEvents<T extends Element = HTMLDivElement> = {
click: CustomEventHandler<MouseEvent, T>;
pointermove: CustomEventHandler<PointerEvent, T>;
focusin: EventHandler<FocusEvent, T>;
keydown: EventHandler<KeyboardEvent, T>;
focusout: EventHandler<FocusEvent, T>;
pointerleave: EventHandler<PointerEvent, T>;
focusin: CustomEventHandler<FocusEvent, T>;
keydown: CustomEventHandler<KeyboardEvent, T>;
focusout: CustomEventHandler<FocusEvent, T>;
pointerleave: CustomEventHandler<PointerEvent, T>;
};

export type SelectTriggerEvents<T extends Element = HTMLButtonElement> = {
Expand All @@ -140,5 +135,5 @@ export type SelectLabelEvents<T extends Element = HTMLSpanElement> = {
};
export type SelectContentEvents<T extends Element = HTMLDivElement> = {
pointerleave: CustomEventHandler<PointerEvent, T>;
keydown: EventHandler<KeyboardEvent, T>;
keydown: CustomEventHandler<KeyboardEvent, T>;
};
Loading