Skip to content

fix(android): gesture single tap incorrect event data - #11632

Open
CatchABus wants to merge 3 commits into
NativeScript:mainfrom
CatchABus:fix/single-double-tap-wrong-data
Open

CatchABus wants to merge 3 commits into
NativeScript:mainfrom
CatchABus:fix/single-double-tap-wrong-data

Conversation

@CatchABus

@CatchABus CatchABus commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

PR Checklist

What is the current behavior?

When an android view has both single and double tap gesture observers, it emits the tap event delay to leave a small time window for a possible double tap.
Unfortunately, the gesture emits the MotionEvent instance with a delay resulting in incorrect data (e.g. android event system resets the motion to event screen coordinates when done).

What is the new behavior?

These changes make sure that a copy of the motion event is kept before the timer.
The timer will emit the copy, hence the event data at the moment of the actual tap.
The PR also includes small changes regarding setTimeout.

@nx-cloud

nx-cloud Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 5df8a17

Command Status Duration Result
nx run-many -t build -p core,webpack5,vite ✅ Succeeded 19s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-11-10 16:36:00 UTC

@pkg-pr-new

pkg-pr-new Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nativescript/core@11632
npm i https://pkg.pr.new/@nativescript/vite@11632
npm i https://pkg.pr.new/@nativescript/webpack@11632

commit: 5df8a17

clearTimeout(this._tapTimeoutId);
} else {
this._tapTimeoutId = null;
if (this._tapTimeoutId != null) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@farfromrefug I made this small change after the review and thought of letting you know.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants