Skip to content
This repository

listview nested in regular list causes error in 1.2 #4901

Closed
marcins opened this Issue August 27, 2012 · 2 comments

2 participants

Marcin Szczepanski Jasper de Groot
Marcin Szczepanski

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

Jasper de Groot
Owner

@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!

Marcin Szczepanski marcins referenced this issue from a commit in marcins/jquery-mobile August 30, 2012
Marcin Szczepanski 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
a77c00a
Jasper de Groot uGoMobi closed this August 29, 2012
Jasper de Groot
Owner

Closing as fixed.

Alexander Schmitz arschmitz referenced this issue from a commit in arschmitz/jquery-mobile August 30, 2012
Marcin Szczepanski 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
d669a22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.