Replies: 1 comment 4 replies
-
|
That all sounds fairly reasonable to me, though obviously we'll need to do some code review and lots of testing. Regarding pointer events, you should look over an old attempt I made: #1645. I was blocked by non-standard iOS Safari behavior I couldn't find a work around for. I suppose it's possible your other changes here might help avoid that bug, but it's hard to say. Especially if you don't have an iOS device for local testing, I'd stay away from pointer events for now. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What is the sentiment towards moving away from the checks on
event.typeandtouchModeinonPointerMoveand instead attaching the correct switch subroutine directly as amousemove/touchmovehandler depending onpointerdownevent type (mousedownortouchdown) and the number of touches?This would roughly equate to the
mousedownhandler attaching themousemovehandler withhandleSinglePointerMoveand amouseuphandler which detaches themousemovehandler and themouseuphandler itself.For touch events, the
pointermoveevent handler is determined every time a pointer is added or removed. So instead oftouchMode, the manipulated variable is a new one namedtouchmoveHandlerwhich is assigned the currently activetouchmoveevent listener so that it can be detached when!touches.lengthor if the element is removed from the DOM mid-interaction.An added benefit of this approach is that the
mouseupandtouchendlisteners are not added prematurely. Currently, these handlers are added as soon as controls are enabled, meaning that they sometimes fire for events which are unrelated to a model-viewer.With the proposed approach the only two persistent handlers would be
touchstartandmousedownon the model-viewer element. The rest are attached and detached in those two on the fly.Is the current implementation done this way to facilitate a migration to pointer events down the line?
Considering that the code is peppered with checks about the pointer type, would it be favorable to migrate to pointer events?
Beta Was this translation helpful? Give feedback.
All reactions