Skip to content

Commit

Permalink
Merge pull request #329 from endlacer/master
Browse files Browse the repository at this point in the history
 fix: #328 a11y - add aria-hidden to hidden textarea
  • Loading branch information
maxisam authored Oct 11, 2024
2 parents 400d889 + 0cb1efa commit 79884e6
Show file tree
Hide file tree
Showing 3 changed files with 3,590 additions and 3,905 deletions.
2 changes: 1 addition & 1 deletion projects/ngx-clipboard/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ngx-clipboard",
"description": "angular 2 clipboard",
"version": "16.0.0",
"version": "16.1.0",
"author": {
"name": "Sam Lin",
"email": "[email protected]"
Expand Down
6 changes: 6 additions & 0 deletions projects/ngx-clipboard/src/lib/ngx-clipboard.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ export class ClipboardService {
// Prevent zooming on iOS
ta.style.fontSize = '12pt';
// Reset box model
ta.style.height = '1px';
ta.style.width = '1px';
ta.style.overflow = 'hidden';
ta.style.clip = 'rect(0 0 0 0);';
ta.style.border = '0';
ta.style.padding = '0';
ta.style.margin = '0';
Expand All @@ -157,6 +161,8 @@ export class ClipboardService {
const yPosition = window.pageYOffset || doc.documentElement.scrollTop;
ta.style.top = yPosition + 'px';
ta.setAttribute('readonly', '');
ta.setAttribute('aria-hidden', 'true');

return ta;
}

Expand Down
Loading

0 comments on commit 79884e6

Please sign in to comment.