Skip to content

Map.isMoving() incorrectly returns true inside mouseup event handler #9647

@DannyDelott

Description

@DannyDelott

mapbox-gl-js version:
1.10.0

browser:
Chrome Version 81.0.4044.129 (Official Build) (64-bit)

It looks like there was a possible regression introduced in mapbox-gl@1.10.0 that affects the result of map.isMoving() inside the mouseup event handler.

Steps to Trigger Behavior

  1. Add a layer to the map, then set a mouseup event handler on it.
  2. Click on one of the layer's feature and call map.isMoving() in the handler.

Link to Demonstration

🐞mapbox-gl@1.10.0 - https://codesandbox.io/s/magical-leavitt-6zhso
mapbox-gl@1.9.1 - https://codesandbox.io/s/lucid-hawking-ruywl

Expected Behavior

Clicking on Maine should output map.isMoving() === false, ie:

map.on('mouseup', statesLayerId, () => {
  map.isMoving() // false
}

Actual Behavior

Clicking on Maine outputs map.isMoving() === true

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions