-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[iOS] Double dash in input field crash fix (#20584)
* [iOS] Double dash in input field fix (#20439) * Added a UiTest (#20439) * Double dash in input field fix - improvements(#20439)
- Loading branch information
Showing
4 changed files
with
84 additions
and
2 deletions.
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 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 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 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
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 | ||
{ | ||
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"); | ||
} | ||
} | ||
} |