ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Tap click component on #document error when tapping on Cordova Google Map

Open loicfavory opened this issue 9 years ago • 15 comments

Ionic version: (check one with "x") [ ] 1.x [ X ] 2.x

I'm submitting a ... (check one with "x") [ X ] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior: Since I updated to 2.0.0-rc4 I have a bug with Cordova Google Maps. If I tap on the map, it cause an error on tap-click component in ionic-angular :

In file node_modules/ionic-angular/components/tap-click/tap-click.js "ele.hasAttribute is not a function", line 203:

export var isActivatable = function (ele) {
    if (ACTIVATABLE_ELEMENTS.indexOf(ele.tagName) > -1) {
        return true;
    }
    for (var i = 0, l = ACTIVATABLE_ATTRIBUTES.length; i < l; i++) {
        if (ele.hasAttribute(ACTIVATABLE_ATTRIBUTES[i])) {
            return true;
        }
    }
    return false;
};

Expected behavior: Map should be tappable without error. Worked fine with 2.0.0-rc3

Steps to reproduce: Install cordova-google-map plugin tap on the map

Related code:

Seems, that when I tap on the map, in fact I tap on #document, #document has no hasAttribute function. I can correct the bug, by testing the type of the function:

export var isActivatable = function (ele) {
    if (ACTIVATABLE_ELEMENTS.indexOf(ele.tagName) > -1) {
        return true;
    }
    for (var i = 0, l = ACTIVATABLE_ATTRIBUTES.length; i < l; i++) {
        if (typeof ele.hasAttribute == "function" && ele.hasAttribute(ACTIVATABLE_ATTRIBUTES[i])) {
            return true;
        }
    }
    return false;
};

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Your system information:

Cordova CLI: 6.4.0 
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.17
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.47-201612152207
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.8
Node Version: v7.0.0
Xcode version: Not installed

loicfavory avatar Dec 20 '16 14:12 loicfavory

This issue was moved to driftyco/ionic-native#901

jgw96 avatar Dec 21 '16 19:12 jgw96

@jgw96 I'm also facing this without using the ionic-native wrapper, It's not and ionic-native issue IMO.

guillenotfound avatar Dec 30 '16 11:12 guillenotfound

@jgw96 Issue in Ionic Native has been closed as a "non ionic native issue" : https://github.com/driftyco/ionic-native/issues/901 Could you reopen this one ?

loicfavory avatar Dec 31 '16 10:12 loicfavory

+1

Abdiliban avatar Jan 04 '17 18:01 Abdiliban

@jgw96 @danbucholtz @brandyscarney I also have this issue after the update to 2.0.0-rc4. With 2.0.0-rc3 map worked fine. As it doesn't seem to be ionic-native issue and seems to be related with some change in Ionic between the two releases, could you please guide us how to fix or workaround it? It's currently a big issue for us, as the map in our app, which worked well suddenly stopped working and we are before a release. Thanks!

Edit: My issue is when clicking on map markers, which open a new page with place details. Page is opened first time only and when going back to map no other pages are opened and each new click on a marker triggers this error.

pdrosos avatar Jan 05 '17 22:01 pdrosos

The same Issue Here ! any workaround?

Hossam-Hawary avatar Jan 10 '17 12:01 Hossam-Hawary

@Hossam-Hawary this workaround worked for me - https://github.com/driftyco/ionic-native/issues/901#issuecomment-268740267 but this definitely needs to be added to a milestone and fixed, as Maps plugin is used by many people.

pdrosos avatar Jan 10 '17 13:01 pdrosos

@pdrosos that works, thanks. yeah definitely needs to be fixed otherwise I need to do the same thing every time I reinstall the node_modules which is ridiculous.

Hossam-Hawary avatar Jan 10 '17 14:01 Hossam-Hawary

Hey everyone! Would you guys mind trying the latest nightly and seeing if you can still repro this issue? To install the nightly you can run npm install ionic-angular@nightly --save --save-exact.

jgw96 avatar Jan 10 '17 22:01 jgw96

On my app keeps happening.

guillenotfound avatar Jan 11 '17 08:01 guillenotfound

@jgw96 still happens here too. Tested with Nexus 5X and Android 7.1.1 and iPhone 6S with iOS 10.1.1.

pdrosos avatar Jan 11 '17 08:01 pdrosos

@jgw96 OK for me with "ionic-angular": "2.0.0-rc.5-201701112208" using ionic run android. Not working using ionic run android --l. Livereload still cause issue in tap-click component.

loicfavory avatar Jan 12 '17 10:01 loicfavory

Just tested the latest nightly: "ionic-angular": "2.0.0-rc.5-201701121905", In my app this error was triggered when I click on a marker in the map, which also prevented the opening of a new place details page. Now the place details page is opened, but the error is still triggered on every marker click.

pdrosos avatar Jan 12 '17 20:01 pdrosos

image

The map is a native view, not related to JavaScript. It means the map and the browser are different views, the map is not rendered inside the browser view, such as HTML.

as it mentioned in the plugin documentation

i think this might be related somehow !

EngMoathOmar avatar Jan 13 '17 14:01 EngMoathOmar

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

ionitron-bot[bot] avatar Sep 04 '18 19:09 ionitron-bot[bot]