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

LinkBox: overlay not working when a child has an opacity < 1 #5630

Closed
1 of 3 tasks
Layvier opened this issue Feb 20, 2022 · 2 comments · Fixed by #5632
Closed
1 of 3 tasks

LinkBox: overlay not working when a child has an opacity < 1 #5630

Layvier opened this issue Feb 20, 2022 · 2 comments · Fixed by #5632
Labels
needs triage Issues and pull requests that need triage attention Type: Bug 🐛 Something isn't working

Comments

@Layvier
Copy link

Layvier commented Feb 20, 2022

Description

When I use LinkBox/Overlay, I expect that setting the opacity of a child text element will not change the overlay behaviour, but instead the transparent text is not "clickable" through the overlay anymore.

Link to Reproduction

https://codesandbox.io/s/laughing-sun-q1qjmw?file=/src/index.tsx

Steps to reproduce

  1. Go to 'the sandbox'
  2. Hover on text below the title of the card
  3. See that it is not clickable, even though it's wrapped within LinkBox

Chakra UI Version

1.7.3

Browser

Brave Browser + Firefox

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

No response

@Layvier Layvier added needs triage Issues and pull requests that need triage attention Type: Bug 🐛 Something isn't working labels Feb 20, 2022
@m4x3d
Copy link
Contributor

m4x3d commented Feb 20, 2022

Thanks for reporting that!

Figured out that this is a problem with the Stacking Context. In the source of the LinkOverlay you can see that there is a zIndex set to 0 in the ::before. This is conflicting with the opacity of the Text. Here is a small example with that zIndex overridden: https://codesandbox.io/s/elegant-varahamihira-9zuwk6?file=/src/index.tsx

Will create a PR in few minutes for this.

@Layvier
Copy link
Author

Layvier commented Feb 21, 2022

Amazing, thanks for the fast reply:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issues and pull requests that need triage attention Type: Bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants