EddyVerbruggen / cordova-plugin-actionsheet

:clipboard: ActionSheet plugin for Cordova iOS and Android apps
208 stars 72 forks source link

PopupMenu for Windows #55

Open brodycj opened 7 years ago

brodycj commented 7 years ago

As discussed in #32 this plugin does not seem to work on Windows 8.1 or Windows 10 UWP. I think the most "native" solution for Windows 10 is to use Windows.UI.Popups.PopupMenu as documented in https://docs.microsoft.com/en-us/uwp/api/windows.ui.popups.popupmenu. (I am not sure about Windows 8.1 or Windows Phone 8.1. I not recommend actively supporting these platforms.)

I made https://github.com/brodybits/cordova-windows-popup-test-app which demonstrates an implementation of this idea based on a fork of cordova-plugin-dialogs (see https://github.com/brodybits/cordova-plugin-dialogs/tree/windows-popup-test-master). The first popup button in this demo shows this working in Windows.UI.Popups.PopupMenu. I think the most tricky part is to calculate the coordinates needed to show the Windows.UI.Popups.PopupMenu in the right place.

I hope we can fix this issue in this plugin. I also raised https://issues.apache.org/jira/browse/CB-12553 in case we want to fix this in cordova-plugin-dialogs as well (or instead).