Bug 53798 - Page.DisplayActionSheet() not dismissable by click outside on UWP
Summary: Page.DisplayActionSheet() not dismissable by click outside on UWP
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.3.3
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Jimmy [MSFT]
Depends on:
Reported: 2017-03-22 18:43 UTC by aculliney
Modified: 2017-12-05 16:43 UTC (History)
4 users (show)

Tags: uwp, actionsheet, fr
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description aculliney 2017-03-22 18:43:11 UTC
In Xamarin.Forms for Win8.1 and Droid, the action sheet shown with Page.DisplayActionSheet() is dismissable by clicking/tapping outside of the popup list UI.

This is not the case with UWP, you cannot dismiss the action sheet by clicking outside the popup UI.  So this regression in behavior practically forces our users to make a choice from the displayed action sheet where before they could click away to dismiss (and trigger the cancellation codepath).

It is worth noting that the ESC key does dismiss the action sheet for both Win8.1 and UWP (but this is not a feasible workaround for our clients who use Surface tablets without hardware keyboards).

We have pushed a reduced test case as a git repo : https://bitbucket.org/luminixinc/xamarintest

Branch for posterity : DisplayActionSheetTest

Find the solution file at : DisplayActionSheetTest/DisplayActionSheetTest.sln

Comment 1 Jimmy [MSFT] 2017-03-22 22:54:29 UTC
I was able to reproduce this issue with the project linked to in the description. This may be related to UWP using a ContentDialog[1] instead of MessageDialog on Windows 8.1, however I am going to confirm this report so the team can investigate and provide more info.

In the meantime, the best workaround seems to be to pass in a value for the 'Cancel' parameter in DisplayActionSheet(), at least when the app is ran on Windows. This will provide a button that dismisses the ActionSheet and returns 'Cancel' as the result.

[1] https://github.com/xamarin/Xamarin.Forms/blob/master/Xamarin.Forms.Platform.UAP/PlatformUWP.cs#L66
Comment 2 Samantha Houts [MSFT] 2017-04-24 18:12:23 UTC
Comment 3 Rui Marinho 2017-12-05 16:43:05 UTC
Should be fixed on 2.6.0-pre1