Occlude "bug" with HTML #1543
simonghales
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey there, I've noticed there's a scenario that leads to unintended results.
Picture this scenario:
What will happen is that the second Html instance, being rendered after the first instance that does have occlusion enabled, will counteract the work done in the first element.
The relevant code is here:
https://github.com/pmndrs/drei/blob/master/src/web/Html.tsx#L194
Essentially because of this if else path, you cannot have a combination of Html elements with occlusion and non-occlusion without running the risk of the canvas element's styles being reset. If the element is being occluded, the z-index for the canvas is calculated and set, otherwise the z-index is set to null.
I'm not sure what the ideal "fix" for this would be. Personally for myself I've just copied the component code and commented out the else statement, and that's sufficient for my use-case. But that isn't necessarily the ideal behaviour / solution for everyone.
Anyway, I figured I'd flag this here in case anyone else encounters the issue and goes searching for a solution.
Beta Was this translation helpful? Give feedback.
All reactions