Skip to content

Commit

Permalink
Merge pull request #135 from bluzky/fix/toggle-button-type
Browse files Browse the repository at this point in the history
Add button type to toggle and toggle group button
  • Loading branch information
bluzky authored Jan 22, 2025
2 parents 78a1183 + b1c600c commit 9159f3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/salad_ui/toggle.ex
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ defmodule SaladUI.Toggle do
<button
onclick="this.querySelector('.toggle-input').click()"
disabled={@disabled}
type="button"
class={
classes([
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 has-[:checked]:bg-accent has-[:checked]:text-accent-foreground",
Expand Down
2 changes: 2 additions & 0 deletions lib/salad_ui/toggle_group.ex
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ defmodule SaladUI.ToggleGroup do
~H"""
<button
onclick="this.querySelector('.toggle-input').click()"
type="button"
disabled={@disabled || @builder.disabled}
class={
classes([
Expand Down Expand Up @@ -114,6 +115,7 @@ defmodule SaladUI.ToggleGroup do
~H"""
<button
onclick="this.querySelector('.toggle-input').click()"
type="button"
disabled={@disabled || @builder.disabled}
class={
classes([
Expand Down

0 comments on commit 9159f3f

Please sign in to comment.