Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby

docs(ds-toggle): warn against external hidden_field_tag with same name (#1925)

Guillem Arias Fauste4bb326fee57a
diff --git a/app/components/DS/toggle.html.erb b/app/components/DS/toggle.html.erb
index 5b9fe94def..327a995b44 100644
--- a/app/components/DS/toggle.html.erb
+++ b/app/components/DS/toggle.html.erb
@@ -1,4 +1,5 @@
<div class="relative inline-block select-none">
+ <%# Paired hidden field carries the off-state value when the checkbox is unchecked. Do NOT add an external `hidden_field_tag` with the same `name` in the caller view — it causes ID/label collisions and duplicate params. %>
<%= hidden_field_tag name, unchecked_value, id: nil %>
<%# `role="switch"` upgrades the underlying checkbox so AT users hear
"switch, on" / "switch, off" instead of "checkbox, checked". The