From 22e8eca5af55e11c41644a498bc941dd859c2680 Mon Sep 17 00:00:00 2001 From: Soren Craig Date: Thu, 9 Jul 2020 17:14:10 -0500 Subject: [PATCH] Revert https://github.com/danielgindi/Charts/pull/4271 and disable parent scroll view on dragging --- Source/Charts/Charts/BarLineChartViewBase.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Charts/Charts/BarLineChartViewBase.swift b/Source/Charts/Charts/BarLineChartViewBase.swift index 1f8fdf81d5..dd0e983d55 100644 --- a/Source/Charts/Charts/BarLineChartViewBase.swift +++ b/Source/Charts/Charts/BarLineChartViewBase.swift @@ -739,6 +739,10 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD // We will only handle highlights on NSUIGestureRecognizerState.Changed _isDragging = false + + // Prevent the parent scroll view from scrolling + _outerScrollView?.nsuiIsScrollEnabled = false + } } else if recognizer.state == NSUIGestureRecognizerState.changed @@ -790,8 +794,6 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD } _isDragging = false - - delegate?.chartViewDidEndPanning?(self) } if _outerScrollView !== nil @@ -799,6 +801,8 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD _outerScrollView?.nsuiIsScrollEnabled = true _outerScrollView = nil } + + delegate?.chartViewDidEndPanning?(self) } }