-
Notifications
You must be signed in to change notification settings - Fork 44
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
hds-clipboard
: add clipboard-polyfill
to support more environments
#2525
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great! I left a suggestion for the changelog, as consumers are likely not familiar with where the hds-clipboard
modifier is used across our library
// to test that this works in a non-secure context, access the port through your IP address (ie. XXX.XXX.X.XXX:4200/) | ||
if (!navigator.clipboard) { | ||
try { | ||
const clipboard = await import('clipboard-polyfill'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks for taking the time to sort this out 👏
📌 Summary
If merged, this PR would include the
clipboard-polyfill
in HDS. Ifnavigator.clipboard.writeText(textToCopy);
fails andnavigator.clipboard
doesn't exist - it will fallback on the polyfill.🔗 External links
Jira ticket: HDS-3840
👀 Component checklist
- [ ] Percy was checked for any visual regression💬 Please consider using conventional comments when reviewing this PR.