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) {
274
274
return false
275
275
}
276
276
277
+ export function isZoomingOrPanningState ( state : State ) {
278
+ return state . panning || state . dragging
279
+ }
280
+
277
281
export function isZoomingOrPanning ( chart : Chart ) {
278
282
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 )
280
286
}
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
11
11
getZoomedScaleBounds ,
12
12
isZoomedOrPanned ,
13
13
isZoomingOrPanning ,
14
+ isZoomingOrPanningState ,
14
15
zoomRect ,
15
16
} from './core'
16
17
import { panFunctions , zoomFunctions , zoomRectFunctions } from './scale.types'
@@ -97,13 +98,13 @@ export default {
97
98
chart : Chart ,
98
99
{ event } : { event : ChartEvent ; replay : boolean ; cancelable : true ; inChartArea : boolean }
99
100
) : boolean | void {
100
- if ( isZoomingOrPanning ( chart ) ) {
101
+ const state = getState ( chart )
102
+ if ( isZoomingOrPanningState ( state ) ) {
101
103
// cancel any event handling while panning or dragging
102
104
return false
103
105
}
104
106
// cancel the next click or mouseup after drag or pan
105
107
if ( event . type === 'click' || event . type === 'mouseup' ) {
106
- const state = getState ( chart )
107
108
if ( state . filterNextClick ) {
108
109
state . filterNextClick = false
109
110
return false
You can’t perform that action at this time.
0 commit comments