Leaflet.DistortableImage: Bug: Multiple image select with boxZoom
Currently to select multiple images, you can use cmd + click. There is another feature, found in the file BoxSelectHandle.js (https://github.com/publiclab/Leaflet.DistortableImage/blob/main/src/edit/BoxSelectHandle.js)
that overrides Leaflet’s default boxZoom to allow for using shift + drag to select multiple images.
However, there is a bug with it so currently the event listener for this functionality is commented out. To test this bug uncomment this line. https://github.com/publiclab/Leaflet.DistortableImage/blob/88fe9281cb7c00cc90c4a52029bf2ca7763553de/src/DistortableCollection.js#L16
Actual behavior

- After click on the map to deselect, clicking an image in the same area as the previous boxSelect area reselects the images for multiple select (something that typically should only be triggered by
cmd + clicknot regular click).
Expected behavior
- By leaving an image out of the boxSelect area, I demonstrate the expected behavior (no reselections on regular click):

Relevant lines of code
- the
BoxSelectHandle.jsfile linked above overrides the default boxZoom handler - in the Leaflet.DisortableCollection.js, the event listener runs the code in https://github.com/publiclab/Leaflet.DistortableImage/blob/88fe9281cb7c00cc90c4a52029bf2ca7763553de/src/DistortableCollection.js#L64-L78 to decide which images to select.
- have to figure out what is causing the reselection (event propagation, event execution deferral, etc.?) and stop it
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 17 (17 by maintainers)
To further clarify on this, notice two different subroutines that occur.
_addSelectiongets executed on every single “mouseup” event@rexagod I fixed this in my pending PR #229 ! I noticed that too
can i try this one?
@jywarren the buggy behavior I was referring to in #158