ionic-framework: Tap click component on #document error when tapping on Cordova Google Map
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
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 15 (4 by maintainers)
Commits related to this issue
- fix(activatableEle): allow document to be an activatable lee Closes #9726 — committed to ionic-team/ionic-framework by adamdbradley 7 years ago
- fix(tap): allow document to be tap polyfilled Closes #9726 — committed to ionic-team/ionic-framework by adamdbradley 7 years ago
- docs(all): refactor docs and add multiple demos to api docs * docs(navctrl): move content from api doc to top-level nav doc * docs(action sheet): edit and clarify docs * docs(action sheet): exp... — committed to ionic-team/ionic-framework by amuramoto 7 years ago
+1
@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.