Rendering state not restored after WebXR AR session ended

Hi,
I have a model viewer web app that allows users to start an AR WebXR session.
This uses the hit test api and it works as in the example except that on exiting the session by clicking the end session button I get a white screen and nothing is rendered when I should be returned to the normal model view. The scene is continuing to render in setAnimationLoop and there are no WebGL errors in the console. The model position is not altered in the session.
I tried resetting the WebGL context in a sessionend event handler but this didn’t work.
How do I restore the rendering state after ending a session?

Is it possible for you to reproduce the issue with one of the official WebXR AR examples? three.js examples

This will make it easier for us to investigate whether it’s an issue of the engine or not.

Hi, the issue was due to the fact that I used document.body as the root for the overlay and the display style property was set to ‘none’ in ARButton.js when the session ended, hiding everything.