-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[iOS] Fix for CursorPosition Property Not Applied Correctly to Entry Control #27220
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
Changes from all commits
4880f68
4fb9ca3
536edb2
1729d0a
1dd75b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| namespace Maui.Controls.Sample.Issues | ||
| { | ||
| [XamlCompilation(XamlCompilationOptions.Compile)] | ||
| [Issue(IssueTracker.Github, 19109, "CursorPosition Property Not Applied Correctly to Entry Control on iOS Platform", PlatformAffected.iOS)] | ||
| public partial class Issue19109: ContentPage | ||
| { | ||
| Entry entry; | ||
| public Issue19109() | ||
| { | ||
| entry = new Entry | ||
| { | ||
| Text = "Entry 123", | ||
| CursorPosition = 5, | ||
| Placeholder = "Focus this entry to check if the cursor position is set correctly.", | ||
| ReturnType = ReturnType.Next, | ||
| AutomationId = "EntryControl" | ||
| }; | ||
|
|
||
| var button = new Button | ||
| { | ||
| Text = "Focus Entry", | ||
| AutomationId = "FocusButton" | ||
| }; | ||
|
|
||
| var label = new Label | ||
| { | ||
| Text = "Cursor Position: 5", | ||
| FontSize = 16, | ||
| TextColor = Colors.Black, | ||
| HorizontalOptions = LayoutOptions.Center | ||
| }; | ||
|
|
||
| button.Clicked += (sender, e) => | ||
| { | ||
| entry.Focus(); | ||
| }; | ||
|
|
||
| Content = new StackLayout | ||
| { | ||
| Children = { entry, button, label }, | ||
| Padding = new Thickness(20), | ||
| Spacing = 10 | ||
| }; | ||
|
|
||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues | ||
| { | ||
| internal class Issue19109 : _IssuesUITest | ||
| { | ||
| public Issue19109(TestDevice device) : base(device) { } | ||
|
|
||
| public override string Issue => "CursorPosition Property Not Applied Correctly to Entry Control on iOS Platform"; | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Entry)] | ||
| public void EntryShouldApplyCursorPositionCorrectly() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The build is failing because the cursor is blinking, not guaranteed will appear in the snapshot: EntryShouldApplyCursorPositionCorrectly
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jsuarezruiz , Thanks for the feedback. The UI test is crucial for verifying that the cursor position is correctly applied to the Entry control, which is central to the fix. Removing the cursor from the snapshot could prevent us from validating this functionality accurately. How can we handle this? |
||
| { | ||
| App.WaitForElement("EntryControl"); | ||
| App.WaitForElement("FocusButton"); | ||
| App.Tap("FocusButton"); | ||
| VerifyScreenshot(); | ||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.