diff --git a/kivy/uix/scrollview.py b/kivy/uix/scrollview.py index f1bdc15be..704f09a7c 100644 --- a/kivy/uix/scrollview.py +++ b/kivy/uix/scrollview.py @@ -722,17 +722,22 @@ class ScrollView(StencilView): def on_touch_move(self, touch): if self._touch is not touch: - # touch is in parent - touch.push() - touch.apply_transform_2d(self.to_local) - super(ScrollView, self).on_touch_move(touch) - touch.pop() + # don't pass on touch to children if outside the sv + if self.collide_point(*touch.pos): + # touch is in parent + touch.push() + touch.apply_transform_2d(self.to_local) + super(ScrollView, self).on_touch_move(touch) + touch.pop() return self._get_uid() in touch.ud if touch.grab_current is not self: return True if touch.ud.get(self._get_uid()) is None: - return super(ScrollView, self).on_touch_move(touch) + # don't pass on touch to children if outside the sv + if self.collide_point(*touch.pos): + return super(ScrollView, self).on_touch_move(touch) + return False touch.ud['sv.handled'] = {'x': False, 'y': False} if self.dispatch('on_scroll_move', touch): @@ -818,13 +823,15 @@ class ScrollView(StencilView): def on_touch_up(self, touch): uid = self._get_uid('svavoid') if self._touch is not touch and uid not in touch.ud: - # touch is in parents - touch.push() - touch.apply_transform_2d(self.to_local) - if super(ScrollView, self).on_touch_up(touch): + # don't pass on touch to children if outside the sv + if self.collide_point(*touch.pos): + # touch is in parents + touch.push() + touch.apply_transform_2d(self.to_local) + if super(ScrollView, self).on_touch_up(touch): + touch.pop() + return True touch.pop() - return True - touch.pop() return False if self.dispatch('on_scroll_stop', touch):