-
Notifications
You must be signed in to change notification settings - Fork 2k
[iOS] Fix Editor losing scrollability after rotation when CharacterSpacing is applied #35309
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
Merged
Merged
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
63cc938
Fixed-35114 : [.NET 10][iOS] D2 - Editor can't be scrolled after rota…
Vignesh-SF3580 2934909
Fix updated.
Vignesh-SF3580 d7b42a9
changes updated.
Vignesh-SF3580 7d73cef
Fix updated
Vignesh-SF3580 5103c08
Update EditorHandler.iOS.cs
Vignesh-SF3580 d1a561c
Update EditorHandler.iOS.cs
Vignesh-SF3580 b28cea5
Update Editor.Mapper.cs
Vignesh-SF3580 064487c
Update Editor.iOS.cs
Vignesh-SF3580 c46c548
Update Editor.cs
Vignesh-SF3580 819f6fe
Update Editor.iOS.cs
Vignesh-SF3580 885eb62
Addressed concerns.
Vignesh-SF3580 6ebe508
Addressed copilot comments.
Vignesh-SF3580 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| namespace Maui.Controls.Sample.Issues; | ||
|
|
||
| [Issue(IssueTracker.Github, 35114, "Editor can not be scrolled after rotating simulator", PlatformAffected.iOS)] | ||
| public class Issue35114 : ContentPage | ||
| { | ||
| public Issue35114() | ||
| { | ||
| Title = "Issue 35114"; | ||
|
|
||
| var slider = new Slider | ||
| { | ||
| AutomationId = "Slider", | ||
| Maximum = 300, | ||
| Minimum = 0 | ||
| }; | ||
|
|
||
| var editor = new Editor | ||
| { | ||
| AutomationId = "TestEditor", | ||
| Text = "testing" | ||
| }; | ||
|
|
||
| editor.BindingContext = slider; | ||
| editor.SetBinding(Editor.CharacterSpacingProperty, new Binding("Value")); | ||
|
|
||
| Content = new VerticalStackLayout | ||
| { | ||
| Children = | ||
| { | ||
| new Label { Text = "1. Play with the value of the slider below and observe as the space between characters widens." }, | ||
| new Label { Text = "2. The tests fails if the space between characters does not change." }, | ||
|
Vignesh-SF3580 marked this conversation as resolved.
Outdated
|
||
| slider, | ||
| editor | ||
| } | ||
| }; | ||
| } | ||
| } | ||
51 changes: 51 additions & 0 deletions
51
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35114.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| #if IOS || ANDROID // The SetOrientation method is only supported on mobile platforms. | ||
|
Vignesh-SF3580 marked this conversation as resolved.
|
||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
|
||
| public class Issue35114 : _IssuesUITest | ||
| { | ||
| public Issue35114(TestDevice device) : base(device) | ||
| { | ||
| } | ||
|
|
||
| public override string Issue => "Editor can not be scrolled after rotating simulator"; | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Editor)] | ||
| public void EditorCanBeScrolledAfterRotation() | ||
| { | ||
| // Step 1: Wait for slider and drag it to max | ||
| var sliderRect = App.WaitForElement("Slider").GetRect(); | ||
| App.DragCoordinates( | ||
| sliderRect.X + 5, | ||
| sliderRect.Y + sliderRect.Height / 2, | ||
| sliderRect.X + sliderRect.Width - 5, | ||
| sliderRect.Y + sliderRect.Height / 2); | ||
| App.WaitForElement("TestEditor"); | ||
|
|
||
| // Step 2: Get editor height before rotation | ||
| var editorRectBefore = App.WaitForElement("TestEditor").GetRect(); | ||
| var heightBefore = editorRectBefore.Height; | ||
|
|
||
| // Step 3: Rotate to landscape | ||
| App.SetOrientationLandscape(); | ||
| App.WaitForElement("TestEditor"); | ||
|
|
||
| // Step 4: Rotate back to portrait | ||
| App.SetOrientationPortrait(); | ||
| // Allow time for layout to settle after rotation | ||
| Task.Delay(2000).Wait(); | ||
|
Vignesh-SF3580 marked this conversation as resolved.
|
||
| App.WaitForElement("TestEditor"); | ||
|
|
||
| // Step 5: Get editor height after rotation — should NOT grow | ||
| var editorRectAfter = App.WaitForElement("TestEditor").GetRect(); | ||
| var heightAfter = editorRectAfter.Height; | ||
|
|
||
| Assert.That(heightAfter, Is.EqualTo(heightBefore).Within(1), | ||
| $"Editor height should not grow after rotation. Before: {heightBefore}, After: {heightAfter}"); | ||
|
Vignesh-SF3580 marked this conversation as resolved.
|
||
| } | ||
| } | ||
| #endif | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.