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

bug: listView._startDrag - Uncaught TypeError: Cannot read property 'freeze' of null #3926

Closed
nantunes opened this issue Jun 11, 2015 · 3 comments

Comments

@nantunes
Copy link

Type: bug

Platform: all

Issue open as requested by @mhartington in #3174 (comment).

PR #3837

Can you provide a detailed description of this issue?
The error ''Uncaught TypeError: Cannot read property 'freeze' of null" appears in the console when dragging an element inside a ion-list item.

How would a robot go about replicating this issue?
I have created a codepen that reproduces the error: http://codepen.io/nantunes/pen/LVLmRJ

Steps to reproduce:
Open the dev tools console and just drag one of the images to the left.

On which platform does this happen occur? (iOS, Android, all, etc.)
On which platform versions does this occur? (Android 4.2, iOS 8, all, etc.)
Tested in Chrome, but probably occurs in all platforms, given the related issue #3174.

Is this an issue with the Ionic Framework or Ionic CLI?
Ionic Framework.

@nantunes nantunes changed the title listView._startDrag - Uncaught TypeError: Cannot read property 'freeze' of null bug: listView._startDrag - Uncaught TypeError: Cannot read property 'freeze' of null Jun 11, 2015
@mhartington
Copy link
Member

So the issue is because you do not have an ion-content wrapping the list.
If you wrap the ion-list with the ion-content, the error goes away.
http://codepen.io/mhartington/pen/aOyjYZ

Why this is happening.
This happens because the swipe buttons should prevent scrolling when they are being swiped. So they call a method on the $ionicScrollDelegate. The issue here is that there is no ion-content/$ionicScrollDelegate. So it throws an error.

Your app won't break, but it will just have an error.

@nantunes
Copy link
Author

Thanks @mhartington, that solves my problem without keeping a private patch.

But it seems the directive's $ionicScroll require is marked as optional (https://github.com/driftyco/ionic/blob/6c9bc15b2996ae9183624c84a2709fd33f80d20b/js/angular/directive/list.js#L90) and I didn't notice such dependency referred in the docs.

Is it necessary/recommended to always wrap the ion-list or only when enabling swipe?

@nantunes
Copy link
Author

Ok, closed PR #3837.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants