cordova-plugin-themeablebrowser icon indicating copy to clipboard operation
cordova-plugin-themeablebrowser copied to clipboard

Menu button events problem (iOS only)

Open antony-k1208 opened this issue 9 years ago • 4 comments

Hey,

when using the menu option with different items, the event corresponding to a specific option isn't triggered correctly.

If you click on a menu option, the menu would close but there is no event emitting. You need to click on the menu icon again (not the menu option, just the menu itself) to receive the earlier missing event. So it seems the event emitting under iOS is somewhat buggy.

Cheers, Antony

antony-k1208 avatar Jul 08 '16 08:07 antony-k1208

please paste in the code for event handling

sencenan avatar Jul 29 '16 16:07 sencenan

Sure, check the following snippet:

themeableBrowserWindowRef = cordova.ThemeableBrowser.open(url, '_blank', browser_options
                    ).addEventListener('backPressed', function (e) {
                        themeableBrowserWindowRef.close();
                        themeableBrowserWindowRef = undefined;
                    }).addEventListener('logoPressed', function (e) {
                        themeableBrowserWindowRef.close();
                        themeableBrowserWindowRef = undefined;
                    }).addEventListener('sharePressed', function (e) {
                        console.log("share pressed");
                        window.plugins.socialsharing.share('Message only');
                    }).addEventListener('openPressed', function (e) {
                        console.log("open pressed");
                        cordova.ThemeableBrowser.open("http://google.de", '_system');
                    }).addEventListener(cordova.ThemeableBrowser.EVT_ERR, function (e) {
                        console.error(e.message);
                    }).addEventListener(cordova.ThemeableBrowser.EVT_WRN, function (e) {
                        console.debug(e.message);
                    }).addEventListener('exit', function (e) {
                        $rootScope.$broadcast("inAppBrowser:exit");
                    });

browser_options contains among other things:

menu: {
        wwwImage: 'images/menu-dots-light.png',
                            wwwImageDensity: 4,
                            title: 'Menu',
                            cancel: 'Cancel',
                            align: 'right',
                            items: [
                                {
                                    event: 'sharePressed',
                                    label: 'Share'
                                },
                                {
                                    event: 'openPressed',
                                    label: 'Open'
                                }
                            ]
    },

Thanks in advance.

Regards, Antony

antony-k1208 avatar Aug 08 '16 14:08 antony-k1208

@sencenan Are you still with me here on this topic? :)

antony-k1208 avatar Sep 29 '16 12:09 antony-k1208

@sencenan Any news here?

antony-k1208 avatar Dec 05 '16 11:12 antony-k1208