Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 600ce78

Browse files
author
Kent Boogaart
committed
Prevent handled events from propagating.
If events are allowed to propagate, then the signature view will not function correctly inside a scroll view. That is, the scroll view will also receive the events and will therefore scroll.
1 parent d0e99a8 commit 600ce78

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/SignaturePad.Android/SignaturePadView.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,9 @@ public override bool OnTouchEvent (MotionEvent e)
587587

588588
switch (e.Action) {
589589
case MotionEventActions.Down:
590+
// don't allow the event to propagate because we're handling it here
591+
Parent.RequestDisallowInterceptTouchEvent(true);
592+
590593
lastX = touchX;
591594
lastY = touchY;
592595

@@ -610,7 +613,10 @@ public override bool OnTouchEvent (MotionEvent e)
610613
(int) (dirtyRect.Bottom + 1));
611614
break;
612615
case MotionEventActions.Up:
613-
handleTouch (e);
616+
// don't allow the event to propagate because we're handling it here
617+
Parent.RequestDisallowInterceptTouchEvent(true);
618+
619+
handleTouch(e);
614620
currentPath = smoothedPathWithGranularity (20, out currentPoints);
615621

616622
//Add the current path and points to their respective lists.

0 commit comments

Comments
 (0)