-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add live region to announce "Copied!" on ClipboardCopy component (#2843)
Co-authored-by: Cameron Dutro <camertron@gmail.com>
- Loading branch information
1 parent
004bf5c
commit 3eccd4e
Showing
7 changed files
with
42 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@primer/view-components": minor | ||
--- | ||
|
||
Adds live region to announce "Copied!" on ClipboardCopy component |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
<%= render Primer::BaseComponent.new(**@system_arguments) do %> | ||
<% if content.present? %> | ||
<%= content %> | ||
<% else %> | ||
<%= render Primer::Beta::Octicon.new(:copy) %> | ||
<%= render Primer::Beta::Octicon.new(:check, color: :success, style: "display: none;") %> | ||
<%= render Primer::BaseComponent.new(tag: :span) do %> | ||
<%= render Primer::BaseComponent.new(**@system_arguments) do %> | ||
<% if content.present? %> | ||
<%= content %> | ||
<% else %> | ||
<%= render Primer::Beta::Octicon.new(:copy) %> | ||
<%= render Primer::Beta::Octicon.new(:check, color: :success, style: "display: none;") %> | ||
<% end %> | ||
<% end %> | ||
<div aria-live="polite" aria-atomic="true" class="sr-only" data-clipboard-copy-feedback></div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters