-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] Fix clear button not working on Entry #7992
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm it still appears to not be working for me
I added the following to Sandbox and the clear button still appears to not be functional:
<VerticalStackLayout>
<Entry
HorizontalOptions="Center"
WidthRequest="300"
ClearButtonVisibility="WhileEditing"
BackgroundColor="LightGray"
Text="ClearButtonVisibility" />
</VerticalStackLayout>
Am I missing something?
Could you try it again?
|
you can set the Text for "" or empty value ,You will see the phenomenon of the bug, the delete button will not show |
The button does not disappear when the text length goes to zero during editing, and the button does not appear if the text length was zero when the Entry gained focus. |
Okay, fixed it so the clear button status updates when the text changes. The button now appears when you add text to a blank entry, and disappears when the entry no longer has text. |
@@ -372,7 +360,7 @@ internal static bool HandleClearButtonTouched(this EditText? platformView, FlowD | |||
if (motionEvent.Action != MotionEventActions.Up) | |||
return false; | |||
|
|||
var x = motionEvent.GetX(); | |||
var x = motionEvent.RawX; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hartez what is RawX vs GetX?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Working now, yay :)
Description of Change
Fix clear button not working on Entry. The FlowDirection used when checking if the tapped point is inside the Clear button Rect was not correct. This PR adds changes to correct the issue.
Can use the .NET MAUI Gallery and the Entry samples to verify the changes.
Issues Fixed
Fixes #7963