Skip to content

Commit

Permalink
Use relative X position of motion event when determining if the butto…
Browse files Browse the repository at this point in the history
…n has been hit (#12753)

Fixes #9954
  • Loading branch information
hartez authored Jan 19, 2023
1 parent 5b4711e commit 41553e1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Core/src/Platform/Android/EditTextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -357,16 +357,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;
Expand Down

0 comments on commit 41553e1

Please sign in to comment.