-
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
[iOS] Readonly Editor - Scrolling fix #20505
Merged
mattleibow
merged 17 commits into
dotnet:main
from
kubaflo:ios-readonly-editor-scroll-fix
Aug 24, 2024
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
8714ea7
[iOS] Readonly editor scroll fix (#19500)
kubaflo 3eb7f14
Added a UiTest (#19500)
kubaflo 6103311
Update ViewExtensions.cs
kubaflo 21733ae
Improvements (#19500)
kubaflo 7fefac3
Merge branch 'main' into ios-readonly-editor-scroll-fix
jsuarezruiz 19f2249
Added pending snapshot
jsuarezruiz e6036e5
Merge branch 'main' into ios-readonly-editor-scroll-fix
jsuarezruiz 6d361a4
Updated snapshot
jsuarezruiz 5b1cc52
Merge branch 'main' into ios-readonly-editor-scroll-fix
jsuarezruiz a0a0ef5
Updated test
jsuarezruiz 7ba641e
Merge branch 'main' into ios-readonly-editor-scroll-fix
jsuarezruiz e93100a
Merge branch 'main' into pr/20505
mattleibow ff758d3
Merge branch 'main' into pr/20505
mattleibow 9b05577
add category
mattleibow 8ddf1af
Merge branch 'main' into pr/20505
mattleibow 5f50733
Hide the InputAccessoryView when read-only
mattleibow 4874cb3
casing
mattleibow 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
14 changes: 14 additions & 0 deletions
14
src/Controls/tests/TestCases.HostApp/Issues/Issue19500.xaml
This file contains 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,14 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Class="Maui.Controls.Sample.Issues.Issue19500"> | ||
<Editor | ||
HeightRequest="100" | ||
IsReadOnly="True" | ||
AutomationId="editor" | ||
Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla porttitor mauris non ornare ultrices. Ut semper ultrices justo eget semper. | ||
Ut imperdiet dolor ut vestibulum molestie. Duis a libero ex. Etiam mi urna, lobortis sed tincidunt in, tempus eget magna. Aenean quis malesuada eros. | ||
Phasellus felis eros, condimentum et tortor sed, condimentum convallis turpis. Sed in varius metus, at auctor orci. Maecenas luctus nibh nibh, | ||
nec aliquam est fermentum in. Etiam consectetur lectus erat, sed placerat sapien rutrum eu. Suspendisse tincidunt fermentum tempor. | ||
Maecenas egestas neque nec lacinia fringilla."/> | ||
</ContentPage> |
15 changes: 15 additions & 0 deletions
15
src/Controls/tests/TestCases.HostApp/Issues/Issue19500.xaml.cs
This file contains 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,15 @@ | ||
using Microsoft.Maui.Controls; | ||
using Microsoft.Maui.Controls.Xaml; | ||
|
||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
[Issue(IssueTracker.Github, 19500, "[iOS] Editor is not be able to scroll if IsReadOnly is true", PlatformAffected.iOS)] | ||
public partial class Issue19500 : ContentPage | ||
{ | ||
public Issue19500() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains 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
28 changes: 28 additions & 0 deletions
28
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19500.cs
This file contains 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,28 @@ | ||
#if IOS | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues | ||
{ | ||
public class Issue19500 : _IssuesUITest | ||
{ | ||
public override string Issue => "[iOS] Editor is not be able to scroll if IsReadOnly is true"; | ||
|
||
public Issue19500(TestDevice device) : base(device) | ||
{ | ||
} | ||
|
||
[Test] | ||
[Category(UITestCategories.Editor)] | ||
public void TextInEditorShouldScroll() | ||
{ | ||
_ = App.WaitForElement("editor"); | ||
App.ScrollDown("editor"); | ||
|
||
// The test passes if the text inside the editor scrolls down | ||
VerifyScreenshot(); | ||
} | ||
} | ||
} | ||
#endif |
Binary file added
BIN
+35.8 KB
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/TextInEditorShouldScroll.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 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 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.
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 wonder if this is all wrong for IEntry too and we should be using the https://learn.microsoft.com/en-us/dotnet/api/uikit.uitextfielddelegate.shouldbeginediting?view=xamarin-ios-sdk-12
But this will still apply for the search bar. So we can do this (investigate at least) later.