[
https://issues.apache.org/jira/browse/CB-12553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15904300#comment-15904300
]
Chris Brody commented on CB-12553:
----------------------------------
I made https://github.com/brodybits/cordova-windows-popup-test-app which
demonstrates the following possibilities:
* Windows popup with 4 button choices, using Windows.UI.Popups.PopupMenu (at
preset coordinates)
* Windows popup with 4 button choices, using an HTML dialog based on the
Windows prompt dialog in cordova-plugin-dialogs
* normal confirm dialog with 2 choices
* normal confirm dialog with 3 choices (BROKEN on Windows mobile)
* multi-page test buttons which may be ignored
This demo uses the
https://github.com/brodybits/cordova-plugin-dialogs#windows-popup-test-master
plugin spec, which references my branch at:
https://github.com/brodybits/cordova-plugin-dialogs/tree/windows-popup-test-master
My new cordova-plugin-dialogs branch adds the following functions:
* navigator.notification.popup() which is like navigator.notification.confirm
but uses Windows.UI.Popups.PopupMenu instead of Windows.UI.Popups.MessageDialog
and requires the popup coordinates
* navigator.notification.popup2() which shows an HTML "popup" dialog, based on
the HTML prompt dialog
In short, my demo shows a couple potential ways to support more than 2 confirm
choices on Windows mobile and more than 3 choices on Windows desktop. The
native PopupMenu integrates better with the Windows platform and disappears
properly if the user hits the back button or clicks outside the popup. But I
can think of the following open questions:
* How to determine the correct coordinates?
* How to deal with the title and message text?
In comparison to the other major mobile platforms:
* On iOS: confirm with 2 choices shows the buttons horizontally while a confirm
with 3 or more choices shows the buttons vertically.
* On Android: confirm shows up to 3 buttons horizontally. Cannot show more than
3 buttons.
I can think of the following alternative approaches:
* Fix confirm to deal with up to 6 choice buttons on iOS, Android, and Windows
(accroding to
https://docs.microsoft.com/en-us/uwp/api/windows.ui.popups.popupmenu the
Windows PopupMenu does not allow more than 6 choices)
* Fix this in https://github.com/EddyVerbruggen/cordova-plugin-actionsheet or
in a brand new plugin instead
* Add a new popup or actionsheet function that shows up to 6 choices as an
action sheet on iOS, popup on Windows, or vertical alert dialog on Android
(could be a partial overlap of EddyVerbruggen cordova-plugin-actionsheet)
> cordova-plugin-dialogs support more confirm choices on Windows
> --------------------------------------------------------------
>
> Key: CB-12553
> URL: https://issues.apache.org/jira/browse/CB-12553
> Project: Apache Cordova
> Issue Type: Improvement
> Components: Plugin Dialogs
> Reporter: Chris Brody
>
> In cordova-plugin-dialogs the confirm dialog has a quirk where it cannot
> display more than 2 buttons on Windows mobile or more than 3 buttons on
> Windows desktop. This can be solved by using `Windows.UI.Popups.PopupMenu`
> instead of `Windows.UI.Popups.MessageDialog` as documented in
> <https://docs.microsoft.com/en-us/uwp/api/windows.ui.popups.popupmenu>.
> An alternative idea to support yes-no-cancel choices on Windows desktop and
> mobile is described in:
> https://maximelabelle.wordpress.com/2016/03/02/displaying-a-yes-no-cancel-message-dialog-in-a-universal-windows-platform-uwp-app/
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]