Skip to content

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

@loicfavory

Description

@loicfavory

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions