-
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.
[Windows] Fix Shell animation and button visual states on Shell nav (#…
…26521) * * Ensure pointer release event is fired on button unload * Clear previous page content presenter on unload to prevent brief visual flash * Add test * Fix test name * Add fix for ImageButton * * Ensure pointer release event is fired on button unload * Clear previous page content presenter on unload to prevent brief visual flash * Add test * Fix test name * Add fix for ImageButton * Adjust logic for content presenter unload * Fix for dupe code * Fix touch/click/press down event * Remove commented code --------- Co-authored-by: Mike Corsaro <mikecorsaro@microsoft.com>
- Loading branch information
Showing
8 changed files
with
165 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
[Issue(IssueTracker.Github, 26466, "Button is not released on unload", PlatformAffected.WinRT)] | ||
public partial class Issue26466 : TestContentPage | ||
{ | ||
protected override void Init() | ||
{ | ||
var button = new Button() | ||
{ | ||
Text = "Hello", | ||
AutomationId = "thebutton" | ||
}; | ||
|
||
var success = new Label | ||
{ | ||
Text = "If you see this, the test has passed", | ||
AutomationId = "success" | ||
}; | ||
|
||
var layout = new Microsoft.Maui.Controls.StackLayout(); | ||
layout.Children.Add(button); | ||
|
||
button.Pressed += (s, e) => | ||
{ | ||
layout.Children.Remove(button); | ||
}; | ||
|
||
button.Released += (s, e) => | ||
{ | ||
layout.Children.Add(success); | ||
}; | ||
|
||
Content = layout; | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue26466.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,33 @@ | ||
#if WINDOWS | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues | ||
{ | ||
public class Issue26466 : _IssuesUITest | ||
{ | ||
const string ButtonId = "thebutton"; | ||
const string SuccessId = "success"; | ||
|
||
public Issue26466(TestDevice testDevice) : base(testDevice) | ||
{ | ||
} | ||
|
||
public override string Issue => "Button is not released on unload"; | ||
|
||
[Test] | ||
[Category(UITestCategories.Button)] | ||
public async Task ButtonReleasedTest() | ||
{ | ||
App.WaitForElement(ButtonId); | ||
App.PressDown(ButtonId); | ||
|
||
await Task.Delay(200); | ||
|
||
// Button should be unloaded, so we should see the success label | ||
App.WaitForElement(SuccessId); | ||
} | ||
} | ||
} | ||
#endif |
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
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