Restore dblclick zoom on add-way behavior#11926
Open
aditya1010-max wants to merge 1 commit intoopenstreetmap:developfrom
Open
Restore dblclick zoom on add-way behavior#11926aditya1010-max wants to merge 1 commit intoopenstreetmap:developfrom
aditya1010-max wants to merge 1 commit intoopenstreetmap:developfrom
Conversation
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses the issue described in #11373
behaviorAddWaydisables 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:
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