-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[iOS] Double dash in input field crash fix #20584
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
rmarinho
merged 3 commits into
dotnet:main
from
kubaflo:ios-double-dash-in-input-field-crash-fix
Mar 4, 2024
Merged
Changes from all commits
Commits
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
25 changes: 25 additions & 0 deletions
25
src/Controls/samples/Controls.Sample.UITests/Issues/Issue20439.xaml
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,25 @@ | ||
| <?xml version="1.0" encoding="utf-8" ?> | ||
| <Shell xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
| x:Class="Maui.Controls.Sample.Issues.Issue20439" | ||
| xmlns:ns="clr-namespace:Maui.Controls.Sample.Issues"> | ||
| <ShellContent | ||
| Title="Home"> | ||
| <ContentPage> | ||
| <StackLayout VerticalOptions="Center"> | ||
| <Entry AutomationId="entry" Text="Tap here"/> | ||
| <Button AutomationId="button" Text="Open the input page" Clicked="Button_Clicked"/> | ||
| </StackLayout> | ||
| </ContentPage> | ||
| </ShellContent> | ||
|
|
||
| <ShellContent | ||
| Title="Text input page"> | ||
| <ContentPage> | ||
| <Editor VerticalOptions="Center" | ||
| AutomationId="editor" | ||
| HeightRequest="100" | ||
| Text="Potential auto correcting words: -- :-) ... omw \n" /> | ||
| </ContentPage> | ||
| </ShellContent> | ||
| </Shell> |
20 changes: 20 additions & 0 deletions
20
src/Controls/samples/Controls.Sample.UITests/Issues/Issue20439.xaml.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,20 @@ | ||
| using Microsoft.Maui.Controls; | ||
| using Microsoft.Maui.Controls.Xaml; | ||
|
|
||
| namespace Maui.Controls.Sample.Issues | ||
| { | ||
| [XamlCompilation(XamlCompilationOptions.Compile)] | ||
| [Issue(IssueTracker.Github, 20439, "[iOS] Double dash in Entry or Editor crashes the app", PlatformAffected.iOS)] | ||
| public partial class Issue20439 : Shell | ||
| { | ||
| public Issue20439() | ||
| { | ||
| InitializeComponent(); | ||
| } | ||
|
|
||
| void Button_Clicked(object sender, System.EventArgs e) | ||
| { | ||
| CurrentItem = Items[1]; | ||
| } | ||
| } | ||
| } |
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,28 @@ | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.AppiumTests.Issues | ||
|
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. file-scoped namespace might be better |
||
| { | ||
| public class Issue20439 : _IssuesUITest | ||
| { | ||
| public override string Issue => "[iOS] Double dash in Entry or Editor crashes the app"; | ||
|
|
||
| public Issue20439(TestDevice device) : base(device) | ||
| { | ||
| } | ||
|
|
||
| [Test] | ||
| public void ErrorShouldNotBeThrown() | ||
| { | ||
| this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.Mac, TestDevice.Windows }); | ||
|
|
||
| _ = App.WaitForElement("entry"); | ||
| App.Click("entry"); | ||
| App.Click("button"); | ||
|
|
||
| // The test passes if no crash is observed | ||
| App.FindElement("editor"); | ||
| } | ||
| } | ||
| } | ||
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.