Skip to content

Commit

Permalink
Merge pull request #10 from huntabyte/fix/button-role
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte authored Aug 8, 2023
2 parents 4692b9b + 8219393 commit 75742cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/fair-laws-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@huntabyte/primitives": patch
---

[Button] Remove default role
4 changes: 2 additions & 2 deletions src/lib/primitives/button/components/Button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
</script>

{#if builders && builders.length}
<!-- svelte-ignore a11y-no-static-element-interactions -->
<svelte:element
this={href ? "a" : "button"}
type={href ? undefined : type}
Expand All @@ -19,7 +20,6 @@
on:keyup
on:mouseenter
on:mouseleave
role="button"
tabindex="0"
use:builderActions={{ builders }}
{...getAttrs(builders)}
Expand All @@ -28,6 +28,7 @@
<slot />
</svelte:element>
{:else}
<!-- svelte-ignore a11y-no-static-element-interactions -->
<svelte:element
this={href ? "a" : "button"}
type={href ? undefined : type}
Expand All @@ -38,7 +39,6 @@
on:keyup
on:mouseenter
on:mouseleave
role="button"
tabindex="0"
{...$$restProps}
>
Expand Down

0 comments on commit 75742cd

Please sign in to comment.