This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[iOS] Change Button state if the touch-up event occurs outside (#11441)
fixes #11430 * Added repro sample * Fixed the issue * Updated the sample Co-authored-by: Samantha Houts <samhouts@users.noreply.github.com>
- Loading branch information
1 parent
4682bef
commit c8ccf60
Showing
4 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue11430.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,55 @@ | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
#if UITEST | ||
[Category(UITestCategories.Frame)] | ||
#endif | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 11430, | ||
"[Bug] [iOS] Button stays in Pressed state if the touch-up event occurs outside", | ||
PlatformAffected.iOS)] | ||
public class Issue11430 : TestContentPage | ||
{ | ||
public Issue11430() | ||
{ | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
Title = "Issue 11430"; | ||
|
||
var layout = new StackLayout(); | ||
|
||
var instructions = new Label | ||
{ | ||
Padding = 12, | ||
BackgroundColor = Color.Black, | ||
TextColor = Color.White, | ||
Text = "Tap a Button, drag your finger outside the Button and lift up your finger. If the Button state is Normal, the test has passed." | ||
}; | ||
|
||
var button = new Button | ||
{ | ||
Text = "Click Me" | ||
}; | ||
|
||
layout.Children.Add(instructions); | ||
layout.Children.Add(button); | ||
|
||
Content = layout; | ||
|
||
button.Clicked += (sender, args) => | ||
{ | ||
DisplayAlert("Issue 11430", "Button Clicked.", "Ok"); | ||
}; | ||
} | ||
} | ||
} |
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