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 (#12936)

Co-authored-by: E.Z. Hart <hartez@gmail.com>
  • Loading branch information
github-actions[bot] and hartez authored Jan 30, 2023
1 parent 8bbdfc9 commit e5ec60b
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 @@ -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;
Expand Down

0 comments on commit e5ec60b

Please sign in to comment.