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

hds-clipboard: add clipboard-polyfill to support more environments #2525

Merged
merged 11 commits into from
Oct 31, 2024

Conversation

shleewhite
Copy link
Contributor

@shleewhite shleewhite commented Oct 29, 2024

📌 Summary

If merged, this PR would include the clipboard-polyfill in HDS. If navigator.clipboard.writeText(textToCopy); fails and navigator.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.

@shleewhite shleewhite requested a review from a team October 29, 2024 15:34
Copy link

vercel bot commented Oct 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
hds-showcase ✅ Ready (Inspect) Visit Preview Oct 31, 2024 2:50pm
hds-website ✅ Ready (Inspect) Visit Preview Oct 31, 2024 2:50pm

Copy link
Contributor

@zamoore zamoore left a comment

Choose a reason for hiding this comment

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

Nice!

package.json Outdated Show resolved Hide resolved
packages/components/package.json Outdated Show resolved Hide resolved
.changeset/soft-pets-hear.md Outdated Show resolved Hide resolved
Copy link
Member

@alex-ju alex-ju left a 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

.changeset/soft-pets-hear.md Outdated Show resolved Hide resolved
// 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');
Copy link
Collaborator

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 👏

@shleewhite shleewhite merged commit a681630 into main Oct 31, 2024
14 checks passed
@shleewhite shleewhite deleted the hds-3840/clipboard-polyfill branch October 31, 2024 15:00
@hashibot-hds hashibot-hds mentioned this pull request Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants