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

Add button type to toggle and toggle group button #135

Merged
merged 1 commit into from
Jan 22, 2025
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
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
Loading