Skip to content

Allow extending multi-selection with Shift while preventing duplicate…#12008

Open
Shyam-123pandey wants to merge 2 commits intoopenstreetmap:developfrom
Shyam-123pandey:fix-multiselection-merge
Open

Allow extending multi-selection with Shift while preventing duplicate…#12008
Shyam-123pandey wants to merge 2 commits intoopenstreetmap:developfrom
Shyam-123pandey:fix-multiselection-merge

Conversation

@Shyam-123pandey
Copy link
Copy Markdown
Contributor

@Shyam-123pandey Shyam-123pandey commented Mar 14, 2026

This change improves multi-selection usability by allowing users to extend the
current selection using Shift + click and Shift + lasso.
Vedio of fixes: https://drive.google.com/file/d/13wMn-91atIUZN0aL4xTrUWcIgXCHHrDE/view?usp=sharing

Previously, new selections would replace the existing selection, making it
difficult to incrementally build a multi-selection.

The implementation merges the current selection (context.selectedIDs())
with the newly selected IDs while ensuring uniqueness using Set() to avoid
duplicate entity IDs.

Behavior after this change:

  • Click → replaces selection
  • Shift + click → adds entity to selection
  • Shift + lasso → adds entities to selection
  • Selecting an already selected entity does not create duplicates.

This addresses usability issue #11134.

Copilot AI review requested due to automatic review settings March 14, 2026 06:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves lasso multi-selection in iD editor by merging newly lasso-selected entities with the existing selection when Shift is held, rather than replacing the selection. It addresses issue #11134 which requested the ability to incrementally build multi-selections.

Changes:

  • Modified behaviorLasso's pointerup handler to accept the event parameter and merge current selection with new lasso selection when Shift is held, using Set for deduplication.
  • Removed a blank line in modules/modes/select.js (cosmetic).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
modules/behavior/lasso.js Added Shift-aware selection merging in lasso pointerup handler
modules/modes/select.js Removed a blank line (cosmetic only)

You can also share your feedback on Copilot code review. Take the survey.

@Shyam-123pandey
Copy link
Copy Markdown
Contributor Author

Hello Sir @tyrasd please check PR and i have one doubt in reply section, please tell there.

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