Skip to content

Commit

Permalink
Fix default toggle state
Browse files Browse the repository at this point in the history
  • Loading branch information
allmarkedup committed Nov 27, 2021
1 parent 558e85e commit ab04c12
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="<%= id %>" x-init="checked = <%= value == "true" ? "true" : "false" %>" data-param-input>
<div id="<%= id %>" x-init="checked = <%= value == true || value == "true" ? "true" : "false" %>" data-param-input>
<button type="button"
class="relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-400"
:class="{'bg-indigo-500': checked, 'bg-gray-300': !checked}"
Expand Down

0 comments on commit ab04c12

Please sign in to comment.