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

Clipboard & Copy Button - Fix handling of empty string and zero values (HDS-4447) #2685

Merged
merged 9 commits into from
Feb 7, 2025

Conversation

KristinLBradley
Copy link
Contributor

@KristinLBradley KristinLBradley commented Feb 4, 2025

📌 Summary

If merged, this PR adds a fix to allow empty strings and zero number values passed into the Copy Button to copy the values.

🛠️ Detailed description

  • Update clipboard modifier used by Copy Button & Copy Snippet to handle passed in empty string and zero number values
  • Add Showcase examples
  • Add tests

🔗 External links


👀 Component checklist

💬 Please consider using conventional comments when reviewing this PR.

Copy link

vercel bot commented Feb 4, 2025

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

Name Status Preview Updated (UTC)
hds-showcase ✅ Ready (Inspect) Visit Preview Feb 6, 2025 7:38pm
hds-website ✅ Ready (Inspect) Visit Preview Feb 6, 2025 7:38pm

Copy link
Contributor

@didoo didoo left a comment

Choose a reason for hiding this comment

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

@KristinLBradley left a few comments; let me know if you want to discuss them in a call if it's not clear or doesn't makes sense to you what I'm suggesting

.changeset/early-knives-fly.md Show resolved Hide resolved
packages/components/src/modifiers/hds-clipboard.ts Outdated Show resolved Hide resolved
showcase/app/templates/components/copy/button.hbs Outdated Show resolved Hide resolved
… and remove test for passing undefined value
Copy link
Contributor

@didoo didoo left a comment

Choose a reason for hiding this comment

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

left a comment around missing showcase use cases for Copy::Snippet. Apart from that, everything is fine for me

@KristinLBradley KristinLBradley requested review from didoo and a team February 6, 2025 17:42
Copy link
Contributor

@didoo didoo left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Nice job! 👏

@KristinLBradley KristinLBradley merged commit 0361b9b into main Feb 7, 2025
14 checks passed
@KristinLBradley KristinLBradley deleted the hds-4447-copybutton-empty-string branch February 7, 2025 20:21
@hashibot-hds hashibot-hds mentioned this pull request Feb 7, 2025
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.

3 participants