-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Windows] Fix pointer released event not being handled on ImageButton (…
…#21766) * Fix pointer released event not being handled on ImageButton * Revert bad file include * Actually implement the scripts needed for right click * Fix merge * Remove dupe release event * Update ref image --------- Co-authored-by: Mike Corsaro <mikecorsaro@microsoft.com>
- Loading branch information
Showing
8 changed files
with
138 additions
and
3 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
src/Controls/samples/Controls.Sample.UITests/Issues/Issue21706.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,40 @@ | ||
<?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.Issue21706" | ||
xmlns:ns="clr-namespace:Maui.Controls.Sample.Issues"> | ||
<VerticalStackLayout> | ||
<ImageButton | ||
Source="groceries.png" | ||
WidthRequest="200" | ||
HeightRequest="200" | ||
AutomationId="WaitForElement" | ||
x:Name="PointerImageButton"> | ||
<VisualStateManager.VisualStateGroups> | ||
<VisualStateGroup | ||
x:Name="CommonStates"> | ||
<VisualState | ||
x:Name="Normal"> | ||
<VisualState.Setters> | ||
<Setter | ||
Property="BackgroundColor" Value="Blue" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
<VisualState | ||
x:Name="PointerOver"> | ||
<VisualState.Setters> | ||
<Setter | ||
Property="BackgroundColor" Value="Red" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
</VisualStateGroup> | ||
</VisualStateManager.VisualStateGroups> | ||
</ImageButton> | ||
|
||
<Button | ||
AutomationId="OtherButton" | ||
WidthRequest="200" | ||
HeightRequest="200" | ||
Text="Other"/> | ||
</VerticalStackLayout> | ||
</ContentPage> |
18 changes: 18 additions & 0 deletions
18
src/Controls/samples/Controls.Sample.UITests/Issues/Issue21706.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,18 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using Microsoft.Maui.Controls; | ||
using Microsoft.Maui.Controls.Xaml; | ||
|
||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
[XamlCompilation(XamlCompilationOptions.Compile)] | ||
[Issue(IssueTracker.Github, 21706, "ImageButton stuck in PointerOver state", PlatformAffected.UWP)] | ||
public partial class Issue21706 : ContentPage | ||
{ | ||
public Issue21706() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
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,25 @@ | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.AppiumTests.Issues | ||
{ | ||
public class Issue21706 : _IssuesUITest | ||
{ | ||
public override string Issue => "ImageButton stuck in PointerOver state"; | ||
|
||
public Issue21706(TestDevice device) : base(device) { } | ||
|
||
[Test] | ||
public async Task ImageButtonStuckAfterRightClick() | ||
{ | ||
this.IgnoreIfPlatforms(new TestDevice[] { TestDevice.Android, TestDevice.Mac, TestDevice.iOS }); | ||
App.WaitForElement("WaitForElement"); | ||
App.RightClick("WaitForElement"); | ||
await Task.Delay(200); | ||
App.Click("OtherButton"); | ||
await Task.Delay(200); | ||
VerifyScreenshot(); | ||
} | ||
} | ||
} |
Binary file added
BIN
+13.6 KB
src/Controls/tests/UITests/snapshots/windows/ImageButtonStuckAfterRightClick.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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