Skip to content

bug: Ionic-1.0.0-rc.0 - Cannot call method "contains" of undefined #3295

@revie

Description

@revie

Type: bug

Platform: android 4.0 webview

I'm getting a javascript error when testing some animation code on an Android 4.0.3 tablet, which says:

Uncaught TypeError: Cannot call method 'contains' of undefined at file:///android_asset/www/lib/ionic/js/ionic.bundle.js:3162

which points to the following line in ionic.requestAnimationFrame():

if (ele.classList.contains('button')) {

Line needs to be changed to the following, to avoid the error:

if (ele.classList && ele.classList.contains('button')) {

Also recommend making the same changes to the classList checks a few lines before and a few lines after the line mentioned to avoid running into the error when checking for class entries of "item" or "pane" as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions