Bug 60405 - DisplayActionSheet Functionality Very Poor
Summary: DisplayActionSheet Functionality Very Poor
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.4.0
Hardware: PC Windows
: Normal major
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-10-27 01:22 UTC by Melbourne Developer
Modified: 2017-11-14 01:33 UTC (History)
4 users (show)

Tags: displayactionsheet, crash, ac
Is this bug a regression?: ---
Last known good build:

Dialog Screenshot (38.45 KB, image/jpeg)
2017-10-27 16:52 UTC, Paul DiPietro [MSFT]

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 for Bug 60405 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Melbourne Developer 2017-10-27 01:22:27 UTC
The design of DisplayAlert / DisplayActionSheet is very poor.

There are a few use cases for alerts and action sheets

1) Display static text to use without response
2) Display static text to user and wait for button click
3) Display static text to user and wait for list view item click

Case one is covered by DisplayAlert. Case two is not really covered. The only button click that is covered is the "Cancel" button. But, a lot of the time, we will just want to display "Ok" / "Cancel" to the user. In the case, we just need two buttons: OK, and Cancel. There is no need for list view functionality, and this only confuses the user. The third case is pretty much covered. You can display a list of items, and you can remove the "Cancel" button so that the user is forced to pick an item.

Also, the popup looks terrible in UWP. Have a look at this eyesore:

To see what I am talking about, clone this repo, run the UWP sample, and click the DisplayActionSheet button:

Firstly, if no list view items are specified, the app will crash, as exemplified by the "Crash App" button. But, we don't want list view items! Who wants to be presented with a list view for a simple "OK" / "Cancel" operation. We need to simply have an OK/Cancel popup.

Secondly, the second button does the job, but why do we have to have a mixture of buttons and list view items? This is very confusing for the user.

*Please improve the functionality so that we can choose either buttons, or list view items, or both. 
*Please fix the bug where providing no list view items crashes the app.
*Please make the popup less ugly.
Comment 1 Paul DiPietro [MSFT] 2017-10-27 16:52:25 UTC
With regards to each of the issues, the first item should probably be considered an enhancement suggestion for the evolution forum as it will be a better avenue than Bugzilla.

The second issue could be considered a bug based on the behavior, so I might suggest focusing this particular report on that aspect. I will set this to confirmed if only because of that particular issue in question, which reproduces using the project.

The third issue I'm unsure of as I don't see the same result on my machine using the project. I'll attach a screenshot, but it might be helpful to get more information on that front and possibly bundle it into the first issue as a side improvement.
Comment 2 Paul DiPietro [MSFT] 2017-10-27 16:52:48 UTC
Created attachment 25488 [details]
Dialog Screenshot
Comment 3 Melbourne Developer 2017-10-30 02:23:52 UTC
Please be specific about which bugs you are referring to here. Which parts are you going to fix, and which aren't you going to fix?
Comment 4 Tomas Berg 2017-11-07 14:00:57 UTC
> Melbourne: *Please make the popup less ugly.

> Pietro: The third issue I'm unsure of as I don't see the same result on my machine using the project.

The popups change in appearance for UWP projects depending on project Target version.
If Target version is set to "Windows 10 (10.0; Build 10586)" you get the "good" looking popup with sensible margins.

If setting the UWP project target to "Windows 10 Anniversary Edition (10.0; build 14393)" (or later? I don't know) then the theme for the popup gets zero margins, making it look bad. 

Workaround: Paste XAML theme resources from https://msdn.microsoft.com/en-us/library/windows/apps/mt299120.aspx into your UWP App.xaml.
Comment 5 Melbourne Developer 2017-11-07 22:22:48 UTC
Excellent. Thanks.