File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -274,7 +274,13 @@ export function isZoomedOrPanned(chart: Chart) {
274274 return false
275275}
276276
277+ export function isZoomingOrPanningState ( state : State ) {
278+ return state . panning || state . dragging
279+ }
280+
277281export function isZoomingOrPanning ( chart : Chart ) {
278282 const state = getState ( chart )
279- return state . panning || state . dragging
283+ // From the perspective of outside callers, zooming and panning are still
284+ // active if we haven't yet cleared the next click.
285+ return ! ! ( isZoomingOrPanningState ( state ) || state . filterNextClick )
280286}
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
1111 getZoomedScaleBounds ,
1212 isZoomedOrPanned ,
1313 isZoomingOrPanning ,
14+ isZoomingOrPanningState ,
1415 zoomRect ,
1516} from './core'
1617import { panFunctions , zoomFunctions , zoomRectFunctions } from './scale.types'
@@ -97,13 +98,13 @@ export default {
9798 chart : Chart ,
9899 { event } : { event : ChartEvent ; replay : boolean ; cancelable : true ; inChartArea : boolean }
99100 ) : boolean | void {
100- if ( isZoomingOrPanning ( chart ) ) {
101+ const state = getState ( chart )
102+ if ( isZoomingOrPanningState ( state ) ) {
101103 // cancel any event handling while panning or dragging
102104 return false
103105 }
104106 // cancel the next click or mouseup after drag or pan
105107 if ( event . type === 'click' || event . type === 'mouseup' ) {
106- const state = getState ( chart )
107108 if ( state . filterNextClick ) {
108109 state . filterNextClick = false
109110 return false
You can’t perform that action at this time.
0 commit comments