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

_hover does not work in MS Edge #2059

Closed
Yardie83 opened this issue Sep 17, 2020 · 3 comments
Closed

_hover does not work in MS Edge #2059

Yardie83 opened this issue Sep 17, 2020 · 3 comments
Assignees
Labels
Topic: Browser Support 🌏 Type: Bug 🐛 Something isn't working workaround available ✌️ Issue has quick hack or walk-around

Comments

@Yardie83
Copy link

Yardie83 commented Sep 17, 2020

Bug report

Describe the bug

_hover pseudo class does not work in MS Edge (locally and on both chakra websites (current/next))
Tried to change the borderRadius on hover on an Avatar component.

I noticed that while the image is still loading, the hover works. Once the image is loaded is stops working.

To reproduce

  1. With MS Edge try to change the borderRadius on hover

Minimal reproduction

https://codesandbox.io/s/keen-water-gmxe7

Expected behavior

Should change borderRadius on hover

Screenshots

Edge:
edge

Firefox:
firefox

Edge (no Image):
noImage

System information

  • Browser: Microsoft Edge: Version 85.0.564.51 (Official build) (64-bit)
  • Version of @chakra-ui/core: 1.0.0-rc.2
  • Version of Node.js: 12.18.3
@ljosberinn
Copy link
Contributor

So I checked, and there are two things going on here:

  • when the image is loaded, you need to use sx to img:hover the underlying image because that's where the borderRadius: 99999 is applied on: https://codesandbox.io/s/holy-butterfly-1yqid - this works in Edge and Firefox
  • when there is no src, the fallback will activate which can actively be changed with _hover, that's what you see in your last gif, that works everywhere too

Sadly can't replicate the 2nd gif, what was the code for that?

@ljosberinn ljosberinn self-assigned this Sep 17, 2020
@ljosberinn ljosberinn added the Status: Awaiting Response ⏳ Waiting for more information from issue author label Sep 17, 2020
@Yardie83
Copy link
Author

Yardie83 commented Sep 21, 2020

Hi, thx for checking. Sorry for the delayed response, I was out of town for the last couple days. Your answers work for me too in Edge.

The code for the second gif is as shown in the gif:
<Avatar _hover={{borderRadius:3}} name="Dan Abrahmov" src="https://bit.ly/dan-abramov" />

Leaving off this part:
sx={{ 'img:hover': { borderRadius: 30, }, }}

If the sx part is added it works as expected.

@ljosberinn
Copy link
Contributor

Sounds good! I understand it is a bit antiintuitive because you have to use sx here and can't directly style via Avatar but I believe given the underlying HTML this is plausible.

@with-heart with-heart added Topic: Browser Support 🌏 workaround available ✌️ Issue has quick hack or walk-around and removed Status: Awaiting Response ⏳ Waiting for more information from issue author Topic: Design and UX ✍️ good first issue 👍 Good for newcomers labels Sep 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Topic: Browser Support 🌏 Type: Bug 🐛 Something isn't working workaround available ✌️ Issue has quick hack or walk-around
Projects
None yet
Development

No branches or pull requests

3 participants