refactor(editable-layer): restrict non-primary click gestures (#247)#669
Open
charlieforward9 wants to merge 2 commits into
Open
refactor(editable-layer): restrict non-primary click gestures (#247)#669charlieforward9 wants to merge 2 commits into
charlieforward9 wants to merge 2 commits into
Conversation
CoverageStmts: 50.91% ▲+0.09% | Branch: 41.99% ▲+0.07% | Funcs: 49.35% ▲+0.15% | Lines: 51.05% ▲+0.10%
|
charlieforward9
commented
Jun 30, 2026
charlieforward9
left a comment
Member
Author
There was a problem hiding this comment.
We've worked with this before - the smarter direction is probably to make a global edit gesture control. left click, right click etc.
Member
Author
|
Addressed the global gesture-control feedback in c33984b: non-primary click/double-click/start-drag events are now filtered at the EditableGeoJsonLayer dispatch point, and drag/stop only continue for primary-button drag sequences. I kept the DrawPolygonByDraggingMode guard as direct-mode protection and added layer-level regression coverage. |
Member
Author
|
@AnJ-K let me know if this works as you expect |
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.
Summary
Fixes #247.
EditableGeoJsonLayerevent gateway before they reach active edit modesDrawPolygonByDraggingModeprimary-button guard for callers that exercise the mode outside the layer gatewayImplementation plan
DrawPolygonByDraggingModedirect-call coverage so mode-level tests still prove the reported bug.Validation
yarnyarn test-node modules/editable-layers/test/editable-layers/editable-geojson-layer.spec.ts modules/editable-layers/test/edit-modes/lib/draw-polygon-by-dragging-mode.spec.tsyarn test-node modules/editable-layers/test/editable-layers modules/editable-layers/test/edit-modes/libyarn lintyarn test: 164 files passed, 1383 tests passed, 9 skippedManual verification
No hosted preview is expected for this package-only behavior fix. To verify locally, run the editable-layers example and use any edit mode; left-button click/drag should edit, while middle/right click/drag should not trigger edit-mode handlers or cancel map/context-menu behavior.
Suggested local preview command:
Then open the editable-layers example route.
Residual risk
This enforces a primary-button edit policy at the layer gateway. If maintainers want configurable alternate gestures later, that should be a separate API design rather than implicit right/middle-button editing.