From e5ec60b96bc848af4a13d29565eeb6875fac0e64 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 16:23:08 +0000 Subject: [PATCH] Use relative X position of motion event when determining if the button has been hit Fixes #9954 (#12936) Co-authored-by: E.Z. Hart --- src/Core/src/Platform/Android/EditTextExtensions.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Core/src/Platform/Android/EditTextExtensions.cs b/src/Core/src/Platform/Android/EditTextExtensions.cs index 536f729f608b..fc2556543e3e 100644 --- a/src/Core/src/Platform/Android/EditTextExtensions.cs +++ b/src/Core/src/Platform/Android/EditTextExtensions.cs @@ -353,16 +353,16 @@ internal static bool HandleClearButtonTouched(this EditText? platformView, Touch if (motionEvent is null) return false; + if (motionEvent.Action != MotionEventActions.Up) + return false; + var rBounds = getClearButtonDrawable?.Invoke()?.Bounds; var buttonWidth = rBounds?.Width(); if (buttonWidth <= 0) return false; - - if (motionEvent.Action != MotionEventActions.Up) - return false; - - var x = motionEvent.RawX; + + var x = motionEvent.GetX(); var y = motionEvent.GetY(); var flowDirection = platformView.LayoutDirection;