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

Changed checkbox partial to checkbox input in place of button #176

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
7 changes: 3 additions & 4 deletions app/views/components/ui/_checkbox.html.erb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<div data-controller="ui--checkbox">
<div class="flex items-center space-x-2">
<button
type="button"
<input
type="checkbox"
role="checkbox"
aria-checked="false"
data-state="unchecked"
value="on"
class="peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground"
for="<%= name %>"
data-action="click->ui--checkbox#toggle"
id="<%= options[:id] %>">
id="<%= options[:id] || name %>">
<span
class="flex items-center justify-center text-current hidden"
style="pointer-events: none">
Expand All @@ -27,7 +27,6 @@
<polyline points="20 6 9 17 4 12"></polyline>
</svg>
</span>
</button>
<%= render_label name: name, label: label, data: {action: "click->ui--checkbox#toggle"} %>
</div>
</div>