From c6399d1ef81a76663e7639fc79b19e5fb905e209 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 17 Jul 2024 12:56:17 +0000 Subject: [PATCH] Double tap fix (backport #6979) [release/4.7.x] (#6981) --- .../travis-double-tap-fix_2024-07-16-22-12.json | 10 ++++++++++ core/frontend/src/tools/ToolAdmin.ts | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 common/changes/@itwin/core-frontend/travis-double-tap-fix_2024-07-16-22-12.json diff --git a/common/changes/@itwin/core-frontend/travis-double-tap-fix_2024-07-16-22-12.json b/common/changes/@itwin/core-frontend/travis-double-tap-fix_2024-07-16-22-12.json new file mode 100644 index 000000000000..ac11a63efe7e --- /dev/null +++ b/common/changes/@itwin/core-frontend/travis-double-tap-fix_2024-07-16-22-12.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/core-frontend", + "comment": "", + "type": "none" + } + ], + "packageName": "@itwin/core-frontend" +} \ No newline at end of file diff --git a/core/frontend/src/tools/ToolAdmin.ts b/core/frontend/src/tools/ToolAdmin.ts index 343e23229512..59b17d3c49a5 100644 --- a/core/frontend/src/tools/ToolAdmin.ts +++ b/core/frontend/src/tools/ToolAdmin.ts @@ -687,8 +687,10 @@ export class ToolAdmin { if (undefined === current.touchTapTimer) { current.touchTapTimer = Date.now(); current.touchTapCount = 1; + // NOTE: We cannot await the executeAfter call below, because that prevents any other + // taps from being processed, which makes it impossible for double tap to happen. // eslint-disable-next-line @typescript-eslint/unbound-method - await ToolSettings.doubleTapTimeout.executeAfter(this.doubleTapTimeout, this); + void ToolSettings.doubleTapTimeout.executeAfter(this.doubleTapTimeout, this); } else if (undefined !== current.touchTapCount) { current.touchTapCount++; }