Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #328 a11y - add aria-hidden to hidden textarea #329

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Loading