Skip to content

Commit

Permalink
fix: Restore HTML raycast zIndex (#1291)
Browse files Browse the repository at this point in the history
* Restore HTML raycast zIndex

* fix: Incorrect selector
  • Loading branch information
FarazzShaikh committed Feb 16, 2023
1 parent faceb40 commit 797b50d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/web/Html.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,17 @@ export const Html = React.forwardRef(

React.useLayoutEffect(() => {
const el = gl.domElement as HTMLCanvasElement
el.style.zIndex = `${Math.floor(zIndexRange[0] / 2)}`
el.style.position = 'absolute'
el.style.pointerEvents = 'none'
}, [])

if (occlude && occlude === 'blending') {
el.style.zIndex = `${Math.floor(zIndexRange[0] / 2)}`
el.style.position = 'absolute'
el.style.pointerEvents = 'none'
} else {
el.style.zIndex = null!
el.style.position = null!
el.style.pointerEvents = null!
}
}, [occlude])

React.useLayoutEffect(() => {
if (group.current) {
Expand Down

1 comment on commit 797b50d

@vercel
Copy link

@vercel vercel bot commented on 797b50d Feb 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.