Skip to content

Pointer lock doesn't work with webview panel in extension #221593

@MJ-Sullivan

Description

@MJ-Sullivan

I am building a vscode extension that creates a webview panel. This panel has a canvas which renders successfully. 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 that are created as part of the webview panel have "allow-pointer-lock" - as mentioned here #104169 - so I don't think that is the problem. I am not finding anything about the error "Uncaught (in promise) DOMException: The root document of this element is not valid for pointer lock" online

Metadata

Metadata

Assignees

Labels

author-verification-requestedIssues potentially verifiable by issue authorfeature-requestRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code Insidersverification-neededVerification of issue is requestedverifiedVerification succeededwebviewWebview issues

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions