Skip to content

Commit

Permalink
Fix wrapping behavior of toggle switch label (#2952)
Browse files Browse the repository at this point in the history
  • Loading branch information
camertron authored Jul 18, 2024
1 parent 01546fb commit 98900f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/pretty-tables-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/view-components': patch
---

Fix wrapping behavior of toggle switch label
Original file line number Diff line number Diff line change
@@ -1 +1 @@
My <em>favorite</em> caption.
My <em>favorite</em> caption lorem ipsum dolor sit amet.
3 changes: 1 addition & 2 deletions lib/primer/forms/toggle_switch.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
<%= content_tag(:div, data: { target: "toggle-switch-input.validationElement" }, **@input.validation_arguments) do %>
<%= content_tag(:span, @input.validation_messages.first, data: { target: "toggle-switch-input.validationMessageElement" }, **@input.validation_message_arguments) %>
<% end %>

<div><%= render(Caption.new(input: @input)) %></div>
</span>
<%= render(Primer::Alpha::ToggleSwitch.new(src: @input.src, csrf_token: @input.csrf, **@input.input_arguments)) %>
<% end %>
<div><%= render(Caption.new(input: @input)) %></div>

0 comments on commit 98900f3

Please sign in to comment.