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

[Feature Request]: Add autoAlign to Button #17168

Open
1 task done
Tracked by #14139
kurtwaldowski-b opened this issue Aug 14, 2024 · 5 comments
Open
1 task done
Tracked by #14139

[Feature Request]: Add autoAlign to Button #17168

kurtwaldowski-b opened this issue Aug 14, 2024 · 5 comments
Labels
component: button package: @carbon/react @carbon/react proposal: accepted This request has gone through triaging and we are accepting PR's against it. severity: 3 https://ibm.biz/carbon-severity type: bug 🐛 type: enhancement 💡 type: infrastructure 🤖 Issues relating to devops, tech debt, etc.
Milestone

Comments

@kurtwaldowski-b
Copy link

The problem

In a recent update, autoAlign was added to tooltips, which allows them to take advantage of floating-ui and always render the tooltip on top. This prevents it from being cut off by surrounding elements, and was a great improvement.

However, most of our tooltips are baked into Buttons and Icon Buttons, and this issue is still persistent for them. There is no way to use autoAlign and prevent tooltips inside of Buttons from being cut off.

The solution

We should align the behavior of the Tooltip component and the baked in tooltip component within buttons and icon buttons.

Examples

Here is a stack blitz demonstrating the issue and current workaround

https://stackblitz.com/edit/vitejs-vite-nwjb3v?file=src%2FApp.tsx

Application/PAL

No response

Business priority

Medium Priority = upcoming release but is not pressing

Available extra resources

No response

Code of Conduct

Copy link
Contributor

Thank you for submitting a feature request. Your proposal is open and will soon be triaged by the Carbon team.

If your proposal is accepted and the Carbon team has bandwidth they will take on the issue, or else request you or other volunteers from the community to work on this issue.

@kurtwaldowski-b
Copy link
Author

I am not positive if this should be opened as a bug or a feature request

@tay1orjones
Copy link
Member

tay1orjones commented Aug 22, 2024

Thanks for opening an issue for this! There's a PR up for adding it to CopyButton, CodeSnippet and IconButton #17138

We can refocus this issue towards just adding it to Button. It's technically an enhancement but we should've covered this earlier as part of adding it to Tooltip, so I'll classify it as a bug too.

@tay1orjones tay1orjones changed the title [Feature Request]: Add autoAlign to Button and IconButton to resolve issues with Tooltip [Feature Request]: Add autoAlign to Button Aug 22, 2024
@tay1orjones tay1orjones added severity: 3 https://ibm.biz/carbon-severity type: bug 🐛 proposal: accepted This request has gone through triaging and we are accepting PR's against it. package: @carbon/react @carbon/react component: button type: infrastructure 🤖 Issues relating to devops, tech debt, etc. and removed status: needs triage 🕵️‍♀️ status: waiting for maintainer response 💬 labels Aug 22, 2024
@tay1orjones
Copy link
Member

This also could be solved by #17003. I'm 50/50 if this should be an explicit prop drilled down to each of these components or if it should be more generally configured with something like what's proposed there. Maybe the best solution is both, I'm not sure. If you have any thoughts on it, please share.

@sstrubberg sstrubberg modified the milestones: 2024 Q3, 2024 Q4 Sep 10, 2024
@tay1orjones
Copy link
Member

tay1orjones commented Sep 27, 2024

Update: I think adding this as an experimental prop on Button for now makes sense. If we change direction we can codemod the change pretty easily

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: button package: @carbon/react @carbon/react proposal: accepted This request has gone through triaging and we are accepting PR's against it. severity: 3 https://ibm.biz/carbon-severity type: bug 🐛 type: enhancement 💡 type: infrastructure 🤖 Issues relating to devops, tech debt, etc.
Projects
Status: ⏱ Backlog
Development

No branches or pull requests

3 participants