-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(slider): expose formatLabel to value tooltip #16616
feat(slider): expose formatLabel to value tooltip #16616
Conversation
All contributors have signed the DCO. |
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
I have read the DCO document and I hereby sign the DCO. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
8145068
to
d8d2b82
Compare
Hey @dkaushik95 sorry for the late reply. This is something would be nice for us to talk with the design team, so we can delivery a consistent solution like it was mentioned here #7581 (comment) I'll make sure to bring that discussion in further meetings with the team. |
d8d2b82
to
f1ab421
Compare
Thanks @guidari , please let me know if there's any other way we can achieve this without this change because we will be needing this functionality soon in our project. |
@guidari This change will enable us to do the migration we need in our product, Instana. Can we please merge? |
This approach seems good to me. The design considerations on that issue are mostly related to the addition of increment "tics", which will still need a scalable solution for programatic/dynamic labels. I think this provides that pretty well. Seems like it would meet the needs of the increments feature if we do eventually take that on. A few suggestions to get this closer to merge:
CleanShot.2024-06-17.at.14.56.42.mp4 |
@tay1orjones Thank you for being open to our suggestions. What is AVT / VRT please? |
Hey @bradelectro
I'm happy to help with this PR to get all checks that Taylor had mentioned. |
I had a conversation with @laurenmrice just now about the design-related concerns of this and we both agreed non-numeric labels are widely used enough (and supported in the a11y spec via Also, If/when the increment/tics are implemented the intent is to allow the input to still be hidden, which means the dynamic tooltip value (the functionality in this PR) will be needed. Once this PR is merged we'll revisit documentation on the website and determine how/if we should update it. |
Thanks @tay1orjones and @guidari. I’ll complete the tests and fix the a11y issue and let you know once I’m done. |
d019f51
to
4955347
Compare
Here's what I've done:
@guidari , @tay1orjones , can you please help me with verifying that the change works well? Thank you! :D |
4955347
to
a4f9f55
Compare
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.
Hey!! The changes are looking good! Just a couple notes
ec51780
to
acf2770
Compare
92914b1
to
a155394
Compare
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.
LGTM! @dkaushik95
Thanks for the contribution!!
- expose formatLabel to thumbWrapper for twoHandles as well as single handle. - add examples on storybooks on how it could be used
- Avt, using tab and getting the value to show as medium - Snapshot test - Unit test to check the behavior for both single and two thumb variants
a155394
to
1a98031
Compare
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.
looks good to go visually. i'll open an issue to address usage guidelines. i think we have some open questions about when to change labels, how many tick marks are allowed, breakpoints, etc.
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.
Thank you again for this 🎉
44338b1
This PR exposes formatLabel to the tooltip for devs to use
Doesn't close a PR but gets us closer to the comment here: #7581 (comment)
Changelog
New
formatLabel
now also works with the Tooltips for the thumbs which gives you more options on how to customize how the value looks.Changed
formatLabel
to represent the above additionTesting / Reviewing
Screenshots