carbon-design-system / carbon

A design system built by IBM
https://www.carbondesignsystem.com
Apache License 2.0
7.85k stars 1.81k forks source link

[Bug]: Link does not navigate when placed inside a Tooltip inside a Tab's label #9912

Closed hnjoshi closed 1 month ago

hnjoshi commented 3 years ago

Code sandbox link for testing: https://codesandbox.io/s/tool-tip-test-glsgf?file=/index.js

I have a Tooltip with learn more link inside Tab's label prop which does not trigger new tab with link.

image

tay1orjones commented 3 years ago

Thanks for opening @hnjoshi! Please use the bug report template when opening issues to help ensure we get all the pieces of information we need to act on reported issues.

I can add some additional context since this was discussed in slack

tay1orjones commented 3 years ago

A workaround (not ideal, but it works) for this would be to apply an onClick handler to the Link and programmatically navigate the browser

https://codesandbox.io/s/tool-tip-test-forked-s4nqz?file=/index.js

hnjoshi commented 3 years ago

It would be good to have actual fix.

imp-dance commented 3 years ago

It would be good to have actual fix.

Have you tried stopping propagation on the link?

<a href="..." onClick={(e) => e.stopPropagation()}>...</a>

Tried on the CodeSandbox, seems to work.

https://codesandbox.io/s/tool-tip-test-forked-2-hy1co?file=/index.js

hnjoshi commented 3 years ago

@imp-dance onClick={e => e.stopPropagation()} This solution works great. Thank you :)

carbon-bot commented 1 month ago

Hi there! 👋 You may have seen that v10 reached it's end of support on September 30, 2024. In the interest of keeping a tidy issue queue, issues flagged as relating to v10 will be closed.

If this issue is still relevant, please open a new issue with a link to this issue and a reproduction that uses v11.

Thanks again for your participation and contributions to this issue and the Carbon ecosystem! 💙