Skip to content

Fix .getAttribute on an element without this method #967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 8, 2016

Conversation

AnthonySendra
Copy link
Contributor

@AnthonySendra AnthonySendra commented Dec 1, 2016

Hello,

I had an error about object doesn't support property or method 'getAttribute' on IE (mainly Cordova on windows desktop) by clicking on a generated link by <router-link>.

<ul>
     <li>
        <router-link class="MainNav-item" :to="{name: 'ArtistListing'}">
          <span class="MainNav-icon"><icon name="micro"></icon></span>
          Artists
        </router-link>
      </li>
      <li>
        <router-link class="MainNav-item" :to="{name: 'CompetitionListing'}">
          <span class="MainNav-icon"><icon name="cup"></icon></span>
          Competition
        </router-link>
      </li>
</ul>

When you click on the generated link, sometimes in src/components/link.js in the method https://github.com/AnthonySendra/vue-router/blob/d065e37e0e19f399597796b5257bfca3a5c79fd6/src/components/link.js#L85 the e.target can be an instance of SVGElementInstance. But this object does not have the method getAttribute. This error causes the application (Cordova) to crash.

My fix will check if the object (the e.target) has the method getAttribute before calling it.

Copy link
Member

@posva posva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fnlctrl WDYT?

@posva posva merged commit e43fdc6 into vuejs:dev Dec 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants