immersive-web / webxr-polyfill

Use the WebXR Device API today, providing fallbacks to native WebVR 1.1 and Cardboard
Apache License 2.0
378 stars 84 forks source link

Element order changes after exiting VR #165

Open WoodNeck opened 1 year ago

WoodNeck commented 1 year ago

If the canvas element is not the only child within its parent / not a last element, the element order can be changed after exiting from the polyfilled XR session.

This can cause an issue where element order is important like some elements should be displayed above other elements.

Of course, this can be bypassed by applying CSS z-index or order to elements, but it would be nice if the polyfill preserve the elements' order.

before

image

in xr session

image

after

image

\<canvas> is appended as the last element