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

[Bug]: CopyButton needs tooltipAlignment and tooltipPosition functionality #10518

Closed
2 tasks done
David-Yuen opened this issue Jan 25, 2022 · 3 comments
Closed
2 tasks done
Labels
component: copy-button role: dev 🤖 severity: 4 https://ibm.biz/carbon-severity type: bug 🐛 version: 10 Issues pertaining to Carbon v10

Comments

@David-Yuen
Copy link

Package

carbon-components-react

Browser

Chrome

Package version

v7.51.0 (latest)

React version

v17.0.2

Description

When using the CopyButton component, the feedback tooltip seems to always be set to the bottom position, and center alignment.

Example of issue:
If we use the CopyButton near the right-side of the page, after clicking the Copy button, a scrollbar appears because of the feedback tooltip being centered and pushing text even farther to the right side.
Screen Shot 2022-01-25 at 11 10 07 AM
A horizontal scrollbar appears because of the feedback tooltip.

Request is to allow developers using this component to pass-in the tooltipAlignment and tooltipPosition fields so that we can avoid this from happening.

Additional Request: It would also be nice to have a built-in tooltip for the hover-over as well

CodeSandbox example

https://codesandbox.io/s/nifty-sky-g5083?file=/src/index.js

Steps to reproduce

  • Simply create a CopyButton component near the right side of the page
  • Set the feedback text to be fairly long
  • Click the Copy button, and the feedback tooltip will always be bottom and centered and unconfigurable

Code of Conduct

@guidari
Copy link
Contributor

guidari commented Jan 9, 2024

This functionality was implemented in this PR with the prop align

Screenshot 2024-01-09 at 17 29 49

@guidari guidari closed this as completed Jan 9, 2024
@David-Yuen
Copy link
Author

@guidari was this delivered to carbon v10?

I think i saw the PR delivered to v11, but not sure about v10. Please confirm

@guidari
Copy link
Contributor

guidari commented Jan 10, 2024

@guidari was this delivered to carbon v10?

I think i saw the PR delivered to v11, but not sure about v10. Please confirm

Ohh, you are right @David-Yuen it was only delivered on v11 not in v10.
I'll reopen the issue! Sorry for the misunderstanding

@guidari guidari reopened this Jan 10, 2024
@guidari guidari added the version: 10 Issues pertaining to Carbon v10 label Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: copy-button role: dev 🤖 severity: 4 https://ibm.biz/carbon-severity type: bug 🐛 version: 10 Issues pertaining to Carbon v10
Projects
Status: ✅ Done
Development

No branches or pull requests

4 participants