Skip to content

Commit

Permalink
Merge pull request #149 from bluzky/fix/switch-not-trigger-form-change
Browse files Browse the repository at this point in the history
Fix phoenix doesn't trigger form change event
  • Loading branch information
bluzky authored Feb 10, 2025
2 parents 87f2d18 + 88af246 commit ab12265
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/salad_ui/switch.ex
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ defmodule SaladUI.Switch do
defp toggle(id) do
%JS{}
|> JS.toggle_attribute({"data-state", "checked", "unchecked"})
|> JS.toggle_attribute({"checked", true}, to: "##{id} input[type=checkbox]")
|> JS.dispatch("click", to: "##{id} input[type=checkbox]", bubbles: false)
end
end

0 comments on commit ab12265

Please sign in to comment.