-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 for Entry SelectionLength #24064
Conversation
Hey there @NirmalKumarYuvaraj! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Can we add a test? |
@@ -146,6 +147,16 @@ static void MapFocus(IEntryHandler handler, IEntry entry, object? args) | |||
handler.PlatformView.Focus(request); | |||
} | |||
|
|||
void OnPlatformViewAttachedToWindow(object? sender, ViewAttachedToWindowEventArgs e) | |||
{ | |||
if (PlatformView.IsAlive() && PlatformView.Enabled) |
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.
Looks good!
I'm thinking you'll be able to add visual tests for this one. If you can't get an automated test for this PR just let us know and we can add a manual one internally.
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.
I have added visual test for this. Please verify
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
These code changes will ensure that SelectionLength is correctly applied both during initial loading and at runtime. |
/azp run |
This comment was marked as outdated.
This comment was marked as outdated.
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18443.cs
Outdated
Show resolved
Hide resolved
This comment was marked as outdated.
This comment was marked as outdated.
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18443.cs
Outdated
Show resolved
Hide resolved
The issue occurs only on the Android platform, so the test case is added only for Android. |
This comment was marked as outdated.
This comment was marked as outdated.
@jfversluis , Could you please review the recent changes and trigger the pipeline. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
/azp run |
This comment was marked as outdated.
This comment was marked as outdated.
Azure Pipelines successfully started running 3 pipeline(s). |
@dotnet-policy-service agree |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Azure Pipelines successfully started running 3 pipeline(s). |
Failing test is unrelated |
Root Cause
The entry control does not automatically receive focus when the view is attached to the window. It can only be focused when the user taps on it or sets the focus manually, such as by using the Tab key. As a result, the entry does not initially have focus.
Description of Change
Verified the behavior of the Editor control, which is similar to the Entry control. The Editor is functioning as expected, so the code changes were implemented in the Entry control as well.
Reference
Referred code changes from EditorHandler.Android.cs file -
maui/src/Core/src/Handlers/Editor/EditorHandler.Android.cs
Line 124 in 698f64d
Issues Fixed
Fixes #18443
Output
Before
Before.mp4
After
After.mp4