Skip to content

Commit 453041c

Browse files
Add missing SR announcement in Summary As Button story (#3867)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 391e438 commit 453041c

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

.changeset/spicy-jars-sparkle.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/view-components": patch
3+
---
4+
5+
Add SR announcement in Summary As Button story

previews/primer/beta/button_preview/summary_as_button.html.erb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
<details>
1+
<span
2+
id="button-summary-live"
3+
class="sr-only"
4+
role="status"
5+
aria-live="polite"
6+
aria-atomic="true"></span>
7+
8+
<details
9+
ontoggle="document.getElementById('button-summary-live').textContent = this.open ? 'A wrapping `details` tag is required when using the button with the `:summary` tag' : ''">
210
<%= render(Primer::Beta::Button.new(
311
scheme: scheme,
412
size: size,
@@ -9,5 +17,6 @@
917
)) do %>
1018
Button
1119
<% end %>
20+
1221
<p>A wrapping `details` tag is required when using the button with the `:summary` tag</p>
1322
</details>

0 commit comments

Comments
 (0)