Skip to content
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

Prevent NPE during ion-slide-box drag #1240

Closed
wants to merge 1 commit into from
Closed

Prevent NPE during ion-slide-box drag #1240

wants to merge 1 commit into from

Conversation

jayproulx
Copy link

Uncaught TypeError: Cannot read property 'contains' of undefined ionic.bundle.js:6182
ionic.views.ListView.ionic.views.View.inherit._getItem ionic.bundle.js:6182
ionic.views.ListView.ionic.views.View.inherit._startDrag ionic.bundle.js:6223
ionic.views.ListView.ionic.views.View.inherit._handleDrag ionic.bundle.js:6266
(anonymous function) ionic.bundle.js:6088
triggerEvent ionic.bundle.js:769
dragGesture ionic.bundle.js:1804
detect ionic.bundle.js:1347
bindDomOnTouch ionic.bundle.js:896

@@ -440,7 +440,7 @@
// Return the list item from the given target
_getItem: function(target) {
while(target) {
if(target.classList.contains(ITEM_CLASS)) {
if(target.classList && target.classList.contains(ITEM_CLASS)) {
Copy link
Author

Choose a reason for hiding this comment

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

I've noticed quite a few instances of target.classList.contains and e.target.classList.contains, which are at risk of the same issue. This PR is only for my current ion-slide-box implementation.

@ajoslin ajoslin closed this in 920dc59 Apr 30, 2014
@ajoslin
Copy link
Contributor

ajoslin commented Apr 30, 2014

Thanks @jayproulx - merged!

@jayproulx jayproulx deleted the listview-with-no-class branch April 30, 2014 16:23
@jayproulx
Copy link
Author

I notice that a gulp build outputs to dist and not release, what's the correct way to update the release build to pick up the latest fixes?

Right now I'm doing a bower install github/driftyco/ionic#commit, I could bower install from my PR fork and copy dist over release but I'm not sure if there's a better way.

@ajoslin
Copy link
Contributor

ajoslin commented Apr 30, 2014

You have to bower install driftyco/ionic-bower#master - our ionic repo only holds stable releases right now unfortunately, since bower does not let us point to the new ionic-bower repo yet.

@jayproulx
Copy link
Author

Thanks @ajoslin

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.

2 participants