MozillaReality / WebXR-emulator-extension

WebXR emulator extension
Mozilla Public License 2.0
454 stars 55 forks source link

Bug - select event should be dispatched before selectend #255

Open De-Panther opened 3 years ago

De-Panther commented 3 years ago

As written in the working draft https://www.w3.org/TR/webxr/#xrinputsource-interface

Queue a task to perform the following steps:
Fire an input source event with name select, frame frame, and source source.
Fire an input source event with name selectend, frame frame, and source source

And in https://developer.mozilla.org/en-US/docs/Web/API/XRSession

The select event is sent after the selectstart event is sent and immediately before the selectend event is sent.

Looking at https://github.com/MozillaReality/WebXR-emulator-extension/blob/dev/polyfill/webxr-polyfill.js

                      this[PRIVATE$f].dispatchInputSourceEvent('selectend',  evt.inputSource);
                      this[PRIVATE$f].dispatchInputSourceEvent('select',  evt.inputSource);

Those lines should be switched

takahirox commented 3 years ago

Thanks for the report! I'll investigate.

De-Panther commented 3 years ago

Was fixed and merged in the WebXR Polyfill repo https://github.com/immersive-web/webxr-polyfill/pull/156