summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul DiPietro <pauldipietro@users.noreply.github.com>2016-10-26 17:11:58 (GMT)
committerRui Marinho <me@ruimarinho.net>2016-10-26 17:46:57 (GMT)
commitdb0c1b33ee584a62a3e6aeb7ede4f73824faba52 (patch)
treed5a5bf975257e50ed0c7783dd8720cfe6ee491bd
parent9f94c71cb5bbe2a0e150c4883a01de9d7dbf8dc7 (diff)
downloadxamarin-forms-db0c1b33ee584a62a3e6aeb7ede4f73824faba52.zip
xamarin-forms-db0c1b33ee584a62a3e6aeb7ede4f73824faba52.tar.gz
xamarin-forms-db0c1b33ee584a62a3e6aeb7ede4f73824faba52.tar.bz2
[iOS] Add check for UIGestureRecognizerState.Cancelled when closing context action (#442)
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44338.cs45
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems5
-rw-r--r--Xamarin.Forms.Platform.iOS/ContextScrollViewDelegate.cs2
3 files changed, 51 insertions, 1 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44338.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44338.cs
new file mode 100644
index 0000000..54fef82
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44338.cs
@@ -0,0 +1,45 @@
+´╗┐using Xamarin.Forms.CustomAttributes;
+using Xamarin.Forms.Internals;
+
+#if UITEST
+using Xamarin.UITest;
+using NUnit.Framework;
+#endif
+
+namespace Xamarin.Forms.Controls.Issues
+{
+ [Preserve(AllMembers = true)]
+ [Issue(IssueTracker.Bugzilla, 44338, "Tapping off of a cell with an open context action causes a crash in iOS 10", PlatformAffected.iOS)]
+ public class Bugzilla44338 : TestContentPage
+ {
+ protected override void Init()
+ {
+ string[] items = new string[] { "A", "B", "C" };
+ Content = new ListView
+ {
+ ItemsSource = items,
+ ItemTemplate = new DataTemplate(() =>
+ {
+ var label = new Label();
+ label.SetBinding(Label.TextProperty, ".");
+ var view = new ViewCell
+ {
+ View = new StackLayout
+ {
+ Children =
+ {
+ label
+ }
+ }
+ };
+ view.ContextActions.Add(new MenuItem
+ {
+ Text = "Action",
+ Command = new Command(() => DisplayAlert("Alert", "Context Action Pressed", "Close"))
+ });
+ return view;
+ })
+ };
+ }
+ }
+} \ No newline at end of file
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
index c56e37e..f5a880a 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
@@ -125,6 +125,11 @@
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla42519.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla43516.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla44166.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla44461.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla44584.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla42832.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla44044.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla44338.cs" />
<Compile Include="$(MSBuildThisFileDirectory)CarouselAsync.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla34561.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla34727.cs" />
diff --git a/Xamarin.Forms.Platform.iOS/ContextScrollViewDelegate.cs b/Xamarin.Forms.Platform.iOS/ContextScrollViewDelegate.cs
index bc04ede..14f95a7 100644
--- a/Xamarin.Forms.Platform.iOS/ContextScrollViewDelegate.cs
+++ b/Xamarin.Forms.Platform.iOS/ContextScrollViewDelegate.cs
@@ -210,7 +210,7 @@ namespace Xamarin.Forms.Platform.iOS
void ClearCloserRecognizer(UIScrollView scrollView)
{
- if (_globalCloser == null)
+ if (_globalCloser == null || _globalCloser.State == UIGestureRecognizerState.Cancelled)
return;
var cell = GetContextCell(scrollView);