Inwerpsel / use-theme-editor

A React theme editor
GNU General Public License v3.0
4 stars 0 forks source link

`pointer-events: none` on an element prevents inspecting it and its children #66

Closed Inwerpsel closed 1 month ago

Inwerpsel commented 7 months ago

Because inspection works with a simple click listener on the document, it won't fire for elements that have pointer-events: none in their stylemap. Instead it will inspect the next parent that doesn't have this property. In some cases this makes important styles impossible to reach.

It's hard to get around because this behavior is baked quite deep: even browser's built in dev tools will adhere to it while inspecting and require you to manually drill down deeper using the inspector tree view. Even document.elementFromPoint will have the same result.

Possible solutions:

Workarounds:

Inwerpsel commented 1 month ago

https://github.com/Inwerpsel/use-theme-editor/commit/50129a7aca2745e6b637c8736835af55c1da813c