Skip to content
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

Fixed Microsoft.Maui.Controls 8.0.90 (Latest stable) Ruins Entry Controls #25006

Merged
merged 30 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9670c6a
Fixed Microsoft.Maui.Controls 8.0.90 (Latest stable) Ruins Entry Cont…
NirmalKumarYuvaraj Sep 30, 2024
270b996
Added test cases
NirmalKumarYuvaraj Oct 3, 2024
17c6812
Merge branch 'main' of https://github.com/NirmalKumarYuvaraj/maui int…
NirmalKumarYuvaraj Oct 3, 2024
606bd95
updated test case method name
NirmalKumarYuvaraj Oct 3, 2024
54a6883
Added automation id
NirmalKumarYuvaraj Oct 4, 2024
269de76
Added pending test snapshot
jsuarezruiz Oct 7, 2024
8cdf977
Added images for android and IOS
NirmalKumarYuvaraj Oct 8, 2024
b6378fa
Merge branch 'fix-24783' of https://github.com/NirmalKumarYuvaraj/mau…
NirmalKumarYuvaraj Oct 8, 2024
b7245c3
Fixed Microsoft.Maui.Controls 8.0.90 (Latest stable) Ruins Entry Cont…
NirmalKumarYuvaraj Sep 30, 2024
02850ce
Added test cases
NirmalKumarYuvaraj Oct 3, 2024
18fffcf
updated test case method name
NirmalKumarYuvaraj Oct 3, 2024
2a5eb1a
Added automation id
NirmalKumarYuvaraj Oct 4, 2024
6709a0a
Added images for android and IOS
NirmalKumarYuvaraj Oct 8, 2024
3f66bbb
Added pending test snapshot
jsuarezruiz Oct 7, 2024
daef7ed
Modified ios image
NirmalKumarYuvaraj Oct 9, 2024
15000b8
Merge branch 'fix-24783' of https://github.com/NirmalKumarYuvaraj/mau…
NirmalKumarYuvaraj Oct 9, 2024
6f24a10
revert unwanted changes
NirmalKumarYuvaraj Oct 9, 2024
586f5c2
Revert "Added pending test snapshot"
NirmalKumarYuvaraj Oct 9, 2024
8d50a3c
Merge branch 'fix-24783' of https://github.com/NirmalKumarYuvaraj/mau…
NirmalKumarYuvaraj Oct 9, 2024
8d59b7b
modified code changes
NirmalKumarYuvaraj Oct 9, 2024
dd65898
Revert "Added pending test snapshot"
NirmalKumarYuvaraj Oct 9, 2024
50a8a12
Reapply "Added pending test snapshot"
NirmalKumarYuvaraj Oct 9, 2024
4ca5d38
Added pending test snapshot
jsuarezruiz Oct 7, 2024
1517643
dummy
NirmalKumarYuvaraj Oct 9, 2024
ddd13dd
Merge branch 'fix-24783' of https://github.com/NirmalKumarYuvaraj/mau…
NirmalKumarYuvaraj Oct 9, 2024
866f6ce
Revert "Merge branch 'fix-24783' of https://github.com/NirmalKumarYuv…
NirmalKumarYuvaraj Oct 9, 2024
f036290
Revert "Merge branch 'fix-24783' of https://github.com/NirmalKumarYuv…
NirmalKumarYuvaraj Oct 9, 2024
9b5c9a2
reverted all the changes
NirmalKumarYuvaraj Oct 9, 2024
c99cbc9
Added missing test cases and images
NirmalKumarYuvaraj Oct 9, 2024
8c1d745
removed unwanted images and files
NirmalKumarYuvaraj Oct 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue25038.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?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"
xmlns:local="clr-namespace:Maui.Controls.Sample.Issues"
x:Class="Maui.Controls.Sample.Issues.Issue25038">

<StackLayout Padding="20">
<!-- First test case: Grid with entry having ClearButtonVisibility set to Never -->
<Grid x:Name="firstEntryGrid" IsVisible="False">
<Entry Text="Initial ClearButton Never Entry" x:Name="initialEntry" ClearButtonVisibility="Never" />
</Grid>

<!-- Second test case: Grid with entry where ClearButtonVisibility changes dynamically -->
<Grid x:Name="secondEntryGrid" IsVisible="False">
<Entry Text="Dynamic ClearButton Entry" x:Name="dynamicClearButtonEntry" ClearButtonVisibility="WhileEditing" />
</Grid>

<!-- Button to trigger the changes -->
<Button Text="Show Entries" AutomationId="button" Clicked="OnShowEntriesClicked"/>
</StackLayout>
</ContentPage>
27 changes: 27 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue25038.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using Microsoft.Maui.Controls.Internals;

namespace Maui.Controls.Sample.Issues
{
[XamlCompilation(XamlCompilationOptions.Compile)]
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 25038, "MAUI Entry in Windows always shows ClearButton if initially hidden and shown even if ClearButtonVisibility set to 'Never'", PlatformAffected.UWP)]
public partial class Issue25038 : ContentPage
{
public Issue25038()
{
InitializeComponent();
}

private void OnShowEntriesClicked(object sender, EventArgs e)
{
// Show the first Grid
firstEntryGrid.IsVisible = true;

// Show the second Grid
secondEntryGrid.IsVisible = true;

// Change ClearButtonVisibility of the second Entry to Never
dynamicClearButtonEntry.ClearButtonVisibility = ClearButtonVisibility.Never;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue25038 : _IssuesUITest
{
public Issue25038(TestDevice testDevice) : base(testDevice)
{
}

public override string Issue => "MAUI Entry in Windows always shows ClearButton if initially hidden and shown even if ClearButtonVisibility set to 'Never'";

[Test]
[Category(UITestCategories.Entry)]
[FailsOnMac]
public void VerifyEntryClearButtonVisibility()
{
App.WaitForElement("button");
App.Tap("button");
VerifyScreenshot();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Triggered the build, it should generate the reference snapshot for this test.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, already added the test snapshot.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the images

}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions src/Core/src/Platform/Windows/MauiTextBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,14 @@ static void OnIsDeleteButtonEnabledPropertyChanged(DependencyObject d, Dependenc
// Adjust the second column's width to 'Auto' when the delete button is enabled, and set it to zero when disabled.
if (deleteButton?.Parent is Grid rootGrid && rootGrid.ColumnDefinitions.Count > 1)
{
int deleteButtonColumnIndex = Grid.GetColumn(deleteButton);
if (GetIsDeleteButtonEnabled(element))
{
rootGrid.ColumnDefinitions[1].Width = new UI.Xaml.GridLength(1, UI.Xaml.GridUnitType.Auto);
rootGrid.ColumnDefinitions[deleteButtonColumnIndex].Width = new UI.Xaml.GridLength(1, UI.Xaml.GridUnitType.Auto);
}
else
{
rootGrid.ColumnDefinitions[1].Width = new UI.Xaml.GridLength(0);
rootGrid.ColumnDefinitions[deleteButtonColumnIndex].Width = new UI.Xaml.GridLength(0);
}
}
}
Expand Down
Loading