I am building a vscode extension that creates a webview panel. This panel uses threejs to render a 3d scene - this happens successfully. Unfortunately, no matter what I try, I cannot get the pointer to lock to the canvas with the scene and in the webview developer tools console, I see this message whenever I requestPointerLock()
"Uncaught (in promise) DOMException: The root document of this element is not valid for pointer lock"
This took me into the world of iframes which webview panels use to create the html document however all the iframes (when I look at the elements) that are created as part of the webview panel have "allow-pointer-lock" - as mentioned here https://github.com/microsoft/vscode/issues/104169 - so I don't think that is the problem.
I have been fiddling for hours trying to get this working or at least get an answer as to why it doesn't work/isn't supported but have made no progress. Has anyone had any success with getting pointer lock to work with a webview panel in their extensions?