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

Fixes #9954
  • Loading branch information
hartez committed Jan 18, 2023
1 parent d2a0048 commit c9752e8
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 c9752e8

Please sign in to comment.