Skip to content

Always restore dblclick-zoom when cancelling add-way behavior - #11926

Merged
tyrasd merged 4 commits into
openstreetmap:developfrom
aditya1010-max:fix-zoom-dblclick
Oct 29, 2026
Merged

tyrasd merged 4 commits into
openstreetmap:developfrom
aditya1010-max:fix-zoom-dblclick

Conversation

@aditya1010-max

@aditya1010-max aditya1010-max commented Feb 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR addresses the issue described in #11373
behaviorAddWay disables double-click zoom when the behavior is installed, but restores it only through a delayed timer in the cancel path. If the mode exits before the timer fires (for example when cancelling quickly or switching modes), the cleanup may not run and double-click zoom can remain disabled.

Fix

Restore double-click zoom synchronously in behavior.off() so that the cleanup runs whenever the behavior is removed.
This ensures double-click zoom is consistently restored on all exit paths, including:

  • finishing a way
  • cancelling the operation
  • switching modes

Result

Double-click zoom is reliably restored after leaving Add Way mode.

This was verified by finishing a way, cancelling the operation, and switching modes to ensure zoom behavior is restored consistently (see clip below).

Fixes

Fixes #11373

Clips

Before

before.mp4

After

after3.mp4

@aditya1010-max

Copy link
Copy Markdown
Contributor Author

@tyrasd I’ve updated the PR description with more details and added short clips demonstrating the issue and the fix.

Would appreciate it if you could take a look whenever you have time.

@matkoniecz

Copy link
Copy Markdown
Collaborator

looking at how it existed in past: previous relevant commit seems aditya1010-max@c74615f

@matkoniecz

Copy link
Copy Markdown
Collaborator

tried really hard to find problems, and I can confirm this is fixing #11373

@tyrasd tyrasd changed the title Restore dblclick zoom on add-way behavior Always restore dblclick-zoom when cancelling add-way behavior Oct 29, 2026
@tyrasd
tyrasd merged commit b5a9504 into openstreetmap:develop Oct 29, 2026
3 checks passed
@tyrasd tyrasd added the bug A bug - let's fix this! label Oct 29, 2026

This branch was successfully deployed

1 active deployment
pr-preview-11926 — 3a14bd34 Deployed Oct 29, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug A bug - let's fix this!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restore the state of the possible double-click zoom-in function after the object addition has been canceled.

4 participants