-
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]Fix for Character Spacing Not Updating Correctly in Editor for D…
…ynamically Added Text (#25347) * fix and UI test added * review changes added * WinUI snap added * fix and UI test added * review changes added * WinUI snap added * fail on mac removed * modified a test case * Removed-TestCases-Failure-Snap * Modified-TestCases * Added-KeyBoard-Hide-Function. * Added-SnapShots * Added-iOS-SnapShot * Updated-Android-SnapShot * Revert "Fixed CollectionViewHandler2 null reference exception if ItemsLayout is set for Tablet but not on mobile devices (#26152)" This reverts commit 0ddc794. * Reapply "Fixed CollectionViewHandler2 null reference exception if ItemsLayout is set for Tablet but not on mobile devices (#26152)" This reverts commit 4b9074c. * Removed-Mac-TestCase-Failing-Code * Added-Mac-Snapshot --------- Co-authored-by: Prakash Kannan <prakash.kannan@syncfusion.com> Co-authored-by: prakashKannanSf3972 <127308739+prakashKannanSf3972@users.noreply.github.com>
- Loading branch information
1 parent
b2654b2
commit 664caaf
Showing
8 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
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
Binary file added
BIN
+60.7 KB
...tCases.Android.Tests/snapshots/android/VerifyEditorCharacterSpacingWithText.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions
65
src/Controls/tests/TestCases.HostApp/Issues/Issue17782.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,65 @@ | ||
<?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.Issue17782" | ||
xmlns:ns="clr-namespace:Maui.Controls.Sample.Issues" | ||
Title="Issue 17782"> | ||
|
||
<VerticalStackLayout x:Name="verticalStack" Spacing="10"> | ||
|
||
<!-- Case 1: Add text to the editor with initial CharacterSpacing set to 10. | ||
The Button click updates the text to a predefined value. --> | ||
<Editor x:Name="initialCharacterSpacingEditor" | ||
AutomationId="InitialCharacterSpacingEditor" | ||
CharacterSpacing="10" | ||
HeightRequest="60"/> | ||
|
||
<Button x:Name="buttonAddEditorText" | ||
AutomationId="ButtonAddEditorText" | ||
Text="Click to Add Editor Text" | ||
Clicked="OnAddEditorTextClicked" | ||
HorizontalOptions="Fill" /> | ||
|
||
<!-- Case 2: Update CharacterSpacing of the editor programmatically. | ||
Initially, the CharacterSpacing is not set, and upon clicking the button, it is updated to 10. --> | ||
<Editor x:Name="dynamicCharacterSpacingEditor" | ||
AutomationId="DynamicCharacterSpacingEditor" | ||
HeightRequest="60" /> | ||
|
||
<Button x:Name="buttonUpdateCharacterSpacing" | ||
AutomationId="ButtonUpdateCharacterSpacing" | ||
Text="Update Dynamic Character Spacing" | ||
Clicked="OnUpdateCharacterSpacingClicked" /> | ||
|
||
<!-- Case 3: Reset CharacterSpacing of the editor to zero. | ||
Initially, the CharacterSpacing is set to 10, and the Button click resets it to 0. --> | ||
<Editor x:Name="resetCharacterSpacingEditor" | ||
AutomationId="ResetCharacterSpacingEditor" | ||
CharacterSpacing="10" | ||
HeightRequest="60" /> | ||
|
||
<Button x:Name="buttonResetCharacterSpacing" | ||
AutomationId="ButtonResetCharacterSpacing" | ||
Text="Reset Character Spacing" | ||
Clicked="OnResetCharacterSpacingClicked" /> | ||
|
||
<!-- Case 4: Bind CharacterSpacing of the editor to a Slider's value. | ||
The Slider allows dynamic adjustment of the editor's CharacterSpacing in real-time. --> | ||
<Editor x:Name="editorWithSlider" | ||
AutomationId="EditorWithSlider" | ||
Text="Editor" | ||
CharacterSpacing="{Binding Value}" | ||
BindingContext="{x:Reference Slider}" /> | ||
|
||
<Slider x:Name="Slider" | ||
AutomationId="SliderCharacterSpacing" | ||
Minimum="0" | ||
Maximum="30" | ||
Value="10" /> | ||
|
||
<Button AutomationId="EditorsUnfocusButton" | ||
Text="Set Editors Unfocus" | ||
Clicked="OnEditorsUnfocusButtonClicked" /> | ||
</VerticalStackLayout> | ||
|
||
</ContentPage> |
39 changes: 39 additions & 0 deletions
39
src/Controls/tests/TestCases.HostApp/Issues/Issue17782.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,39 @@ | ||
using System.Collections.ObjectModel; | ||
|
||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
|
||
[Issue(IssueTracker.Github, 17782, "[ManualMauiTests] New text in the Editor character spacing test sometimes uses the previous spacing", PlatformAffected.iOS)] | ||
public partial class Issue17782 : ContentPage | ||
{ | ||
|
||
public Issue17782() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void OnAddEditorTextClicked(object sender, EventArgs e) | ||
{ | ||
initialCharacterSpacingEditor.Text = "Initial CharacterSpacing with Text"; | ||
} | ||
|
||
private void OnUpdateCharacterSpacingClicked(object sender, EventArgs e) | ||
{ | ||
dynamicCharacterSpacingEditor.CharacterSpacing = 10; | ||
} | ||
|
||
private void OnResetCharacterSpacingClicked(object sender, EventArgs e) | ||
{ | ||
resetCharacterSpacingEditor.CharacterSpacing = 0; | ||
} | ||
|
||
private void OnEditorsUnfocusButtonClicked(object sender, EventArgs e) | ||
{ | ||
foreach(var child in verticalStack.Children) | ||
{ | ||
if(child is Editor editor) | ||
editor.Unfocus(); | ||
} | ||
} | ||
} | ||
} |
Binary file added
BIN
+61.1 KB
...ests/TestCases.Mac.Tests/snapshots/mac/VerifyEditorCharacterSpacingWithText.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions
31
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue17782.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,31 @@ | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
||
public class Issue17782 : _IssuesUITest | ||
{ | ||
public Issue17782(TestDevice testDevice) : base(testDevice) | ||
{ | ||
} | ||
|
||
public override string Issue => "[ManualMauiTests] New text in the Editor character spacing test sometimes uses the previous spacing"; | ||
|
||
[Test] | ||
[Category(UITestCategories.Editor)] | ||
public void VerifyEditorCharacterSpacingWithText() | ||
{ | ||
App.WaitForElement("SliderCharacterSpacing"); | ||
App.Click("ButtonAddEditorText"); | ||
App.Click("ButtonUpdateCharacterSpacing"); | ||
App.EnterText("DynamicCharacterSpacingEditor", "Text"); | ||
App.Click("ButtonResetCharacterSpacing"); | ||
App.EnterText("ResetCharacterSpacingEditor", "Text"); | ||
App.Click("EditorsUnfocusButton"); | ||
#if IOS | ||
App.DismissKeyboard(); | ||
#endif | ||
VerifyScreenshot(); | ||
} | ||
} |
Binary file added
BIN
+15.4 KB
...estCases.WinUI.Tests/snapshots/windows/VerifyEditorCharacterSpacingWithText.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+63.2 KB
...ests/TestCases.iOS.Tests/snapshots/ios/VerifyEditorCharacterSpacingWithText.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.