Skip to content

Commit

Permalink
Ensure throttling does not break capture_scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhi committed Feb 15, 2023
1 parent 31ae91d commit 3662170
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/mpl_widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,11 @@ export class MPLCanvasView extends DOMWidgetView {
this.model.get('pan_zoom_throttle')
)
);
top_canvas.addEventListener('wheel', (event: any) => {
if (this.model.get('capture_scroll')) {
event.preventDefault();
}
});

canvas_div.appendChild(canvas);
canvas_div.appendChild(top_canvas);
Expand Down Expand Up @@ -708,9 +713,6 @@ export class MPLCanvasView extends DOMWidgetView {
} else {
event.step = -1;
}
if (this.model.get('capture_scroll')) {
event.preventDefault();
}
}

if (name === 'button_press') {
Expand Down

0 comments on commit 3662170

Please sign in to comment.