Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset isDragging state if panning is disabled dynamically #7940

Merged
merged 1 commit into from
Jun 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Reset isDragging state if panning is disabled dynamically
  • Loading branch information
Pessimistress committed Jun 7, 2023
commit 1b1ed579d9c42eed7a29481d2231688a80e08a1a
3 changes: 2 additions & 1 deletion modules/core/src/controllers/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ export default abstract class Controller<ControllerState extends IViewState<Cont
// Register/unregister events
const isInteractive = Boolean(this.onViewStateChange);
this.toggleEvents(EVENT_TYPES.WHEEL, isInteractive && scrollZoom);
this.toggleEvents(EVENT_TYPES.PAN, isInteractive && (dragPan || dragRotate));
// We always need the pan events to set the correct isDragging state, even if dragPan & dragRotate are both false
this.toggleEvents(EVENT_TYPES.PAN, isInteractive);
this.toggleEvents(EVENT_TYPES.PINCH, isInteractive && (touchZoom || touchRotate));
this.toggleEvents(EVENT_TYPES.TRIPLE_PAN, isInteractive && touchRotate);
this.toggleEvents(EVENT_TYPES.DOUBLE_TAP, isInteractive && doubleClickZoom);
Expand Down