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

listview nested in regular list causes error in 1.2 #4901

Closed
marcins opened this Issue Aug 28, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@marcins
Contributor

marcins commented Aug 28, 2012

I have a listview that's within a set of "tabs" which are implemented as a list. With jQuery Mobile 1.2 Alpha 1 this causes an error as it appears that when jQM enhances the nested listview it also tries to enhance the bare list containing it. See this jsFiddle for a minimal testcase:

http://jsfiddle.net/marcins/7QtxZ/

I've had a look and the error occurs around line 29 of listview.autodividers.js because the call does not check that the listview actually contains something, the statement:

if ( !listview.options.autodividers ) {

should probably be

if ( !listview || !listview.options.autodividers ) {

This occurs on Chrome 21.0.1180.82 and 23.0.1246.0 canary, Safari 6.0 (8536.25) on Mac OS 10.8.1

@jaspermdegroot

This comment has been minimized.

Show comment
Hide comment
@jaspermdegroot

jaspermdegroot Aug 29, 2012

Member

@marcins

That change looks good to me and passes all tests. Do you want to create a PR for it or want us to commit the change?
Thanks!

Member

jaspermdegroot commented Aug 29, 2012

@marcins

That change looks good to me and passes all tests. Do you want to create a PR for it or want us to commit the change?
Thanks!

@ghost ghost assigned jaspermdegroot Aug 29, 2012

marcins added a commit to marcins/jquery-mobile that referenced this issue Aug 29, 2012

Listview: add extra check to fix issue #4901
If a listview was nested inside a normal list then the listviewcreate
event for autodividers would also fire for the parent list causing an error
as this list did not contain listview data. An extra check is added to ensure
the list is actually a listview.

Fixes issue #4901

jaspermdegroot added a commit that referenced this issue Aug 30, 2012

Merge pull request #4909 from marcins/issue-4901
Listview: add extra check to fix issue #4901
@jaspermdegroot

This comment has been minimized.

Show comment
Hide comment
@jaspermdegroot

jaspermdegroot Aug 30, 2012

Member

Closing as fixed.

Member

jaspermdegroot commented Aug 30, 2012

Closing as fixed.

arschmitz added a commit to arschmitz/jquery-mobile that referenced this issue Oct 16, 2012

Listview: add extra check to fix issue #4901
If a listview was nested inside a normal list then the listviewcreate
event for autodividers would also fire for the parent list causing an error
as this list did not contain listview data. An extra check is added to ensure
the list is actually a listview.

Fixes issue #4901
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment