Skip to content

Commit

Permalink
#119 add aria-hidden attribute to avoid screen readers narrating the …
Browse files Browse the repository at this point in the history
…copied text
  • Loading branch information
sudodoki authored and sudodoki committed Aug 2, 2022
1 parent 6c9ea9e commit 4b0d1f8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ function copy(text, options) {

mark = document.createElement("span");
mark.textContent = text;
// avoid screen readers from reading out loud the text
mark.ariaHidden = "true"
// reset user styles for span element
mark.style.all = "unset";
// prevents scrolling to the end of the page
Expand Down

0 comments on commit 4b0d1f8

Please sign in to comment.