iTwin / itwinjs-core

Monorepo for iTwin.js Library
https://www.itwinjs.org
MIT License
591 stars 211 forks source link

Double tapping on mobile no longer invokes fit view #6976

Closed Modeeeeeee closed 1 month ago

Modeeeeeee commented 1 month ago

Describe the bug After upgrading iTwin version on our mobile app (Synchro FieldApp) to 4.5.1 could no longer invoke fit view by double tapping. Pinching, zooming, two finger dragging works fine but double tapping using the IdleTool no longer works

To Reproduce Steps to reproduce the behavior:

  1. Open an iModel
  2. Try to zoom out and pan the screen away from the model geometrics
  3. Double tap to try invoke fit view
  4. Fit view doesn't work

Expected behavior By following the iTwin.js documentation : For touch devices, the Idle tool associates the following touch events with viewing operations:

Single finger drag to rotate the view Two-finger drag to pan the view Double tap to fit the view Pinch to zoom the view in and out

Screenshots https://github.com/user-attachments/assets/555a618d-f6dc-4900-9f47-8b9ea2753c08

Additional context From a short debugging session what I at least found out is that I was not able to register the double click in the time window of 250ms (ToolSettings.doubleTapTiemout = BeDuration.fromMilliseconds(250)). In the tool admin code double click is handled in the onTouch event handling function. After trying to debug when it happens using console logs in the safari debugger these are the timings at least I got : [Log] Awaiting doubleTapTimeout at : 1721057190112 [Log] Awaiting doubleTapTimeout at : 1721057190395 [Log] Awaiting doubleTapTimeout at : 1721112049694 [Log] Awaiting doubleTapTimeout at : 1721112050079 I tried spam clicking with the mouse in the simulator but still had no success to get that 250ms window to register two taps.

tcobbs-bentley commented 1 month ago

It appears that double tap events are never being generated by ToolAdmin. I am investigating, but I first have to understand what the code is trying to do before I can figure out why it's not working. @bbastings do you have any hints on how I might track this down?

tcobbs-bentley commented 1 month ago

PR created with fix: https://github.com/iTwin/itwinjs-core/pull/6979

tcobbs-bentley commented 1 month ago

@Modeeeeeee: The PR has completed and been backported to 4.7. I will do another iTwin Mobile SDK release after the next iTwin 4.7 release.

tcobbs-bentley commented 1 month ago

@Modeeeeeee: iTwin Mobile SDK 0.22.10 has now been released using an iTwin version with this fix.