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

feat: forward additional events from <Button> #550

Merged
merged 2 commits into from
May 21, 2024
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
5 changes: 5 additions & 0 deletions .changeset/clever-rockets-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"bits-ui": patch
---

feat: forward additional events from `<Button>`
8 changes: 8 additions & 0 deletions packages/bits-ui/src/lib/bits/button/components/button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
on:keyup
on:mouseenter
on:mouseleave
on:mousedown
on:pointerdown
on:mouseup
on:pointerup
tabindex="0"
use:builderActions={{ builders }}
{...getAttrs(builders)}
Expand All @@ -47,6 +51,10 @@
on:keyup
on:mouseenter
on:mouseleave
on:mousedown
on:pointerdown
on:mouseup
on:pointerup
tabindex="0"
{...$$restProps}
{...attrs}
Expand Down
4 changes: 4 additions & 0 deletions packages/bits-ui/src/lib/bits/button/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ export type ButtonEvents = {
keyup: ButtonEventHandler<KeyboardEvent>;
mouseenter: ButtonEventHandler<MouseEvent>;
mouseleave: ButtonEventHandler<MouseEvent>;
mousedown: ButtonEventHandler<MouseEvent>;
mouseup: ButtonEventHandler<MouseEvent>;
pointerdown: ButtonEventHandler<PointerEvent>;
pointerup: ButtonEventHandler<PointerEvent>;
};