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

is-hovered css class application quirks #27296

Closed
jameskoster opened this issue Nov 26, 2020 · 2 comments
Closed

is-hovered css class application quirks #27296

jameskoster opened this issue Nov 26, 2020 · 2 comments
Assignees
Labels
[Feature] Blocks Overall functionality of blocks Needs Dev Ready for, and needs developer efforts [Type] Bug An existing feature does not function as intended

Comments

@jameskoster
Copy link
Contributor

Whilst working on #27271 I noticed a couple of strange instances where the is-hovered class it not correctly applied. The first one is block placeholders, please observe:

hovered

I added a red outline to highlight the elements that seem to block the class being added. Interestingly, hovering the elements inside those elements does not seem to block the class being added.

A similar thing happens with link blocks in the navigation block:

hovered-2

cc @jasmussen

@jameskoster jameskoster added the [Feature] Blocks Overall functionality of blocks label Nov 26, 2020
@jasmussen
Copy link
Contributor

Excellent GIF usage. Definitely helpful for debugging.

@jeyip
Copy link
Contributor

jeyip commented Feb 4, 2021

After doing some digging:

mouseleave and mouseout are similar but differ in that mouseleave does not bubble and mouseout does. This means that mouseleave is fired when the pointer has exited the element and all of its descendants, whereas mouseout is fired when the pointer leaves the element or leaves one of the element's descendants (even if the pointer is still within the element).

Using the navigation link as an example, when we hover over text, even though it's clearly a child of the navigation link <li> tag, mouseout is still triggered. This is because, even though the pointer is still within the <li> tag, it is technically "mousing out" of the current element and mousing over a new element (its descendent).

Using mouseleave instead of mouseout seems like a promising alternative, but the general behavior of editor hover states and hover outlines changes noticeably. I'm not sure if these changes make the experience better or worse, but I'll spin up a PR for folks to play around with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks Needs Dev Ready for, and needs developer efforts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants