Skip to content

Commit

Permalink
feat: forward additional events from <Button> (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte authored May 21, 2024
1 parent 47e0ce9 commit 46e5828
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
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>;
};

0 comments on commit 46e5828

Please sign in to comment.