-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NumberField] Fix failing browser tests #317
Conversation
try { | ||
// Avoid non-deterministic errors in testing environments. This error sometimes | ||
// appears: | ||
// "The root document of this element is not valid for pointer lock." | ||
// We need to await it even though it doesn't appear to return a promise in the | ||
// types in order for the `catch` to work. | ||
await ownerDocument(scrubAreaRef.current).body.requestPointerLock(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Types suggest you don't need await
, but I think you do for some browsers/envs?... 🫠
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this error also sometimes appeared for document.body.requestPointerLock()
, so it doesn't seem related to ownerDocument
.
96c2de8
to
5057e0a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests do pass now 👍
Draft to experiment, these somehow started failing after merge