You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.
When using jQuery 1.8.0, in a site with a persistent footer toolbar containing a navbar, and no persistent header, extra text elements containing zeroes are being added to the end of the DOM whenever the page is changed through the footer navbar. This issue does not exist with jQuery 1.7.2
At this point, if there is no persistent header, the variable nextHeader has a value of 0. On line 159, nextFooter.add( nextHeader ) produces an array containing the footer jQ object and a value of zero. In jQuery 1.7.2, when appended to the document, the 0 is ignored. in jQuery 1.8.0, it is added as a text element.
It could be argued this is a bug with jQuery, but it seems like there might be a line missing which would fix this very easily. We already assign nextFooter to an empty jQ object if it is blank, so we could add the same for nextHeader after line 155: nextHeader = nextHeader || $();
Use the footer tabs in the output window to switch pages. Notice zeroes being added to the document. Uncomment the jQuery 1.7.2 script tag in the HTML header and remove the jQuery 1.8.0 script tag. Try the tabs again. The problem no longer occurs.
Steps to reproduce
Create a new jQuery mobile project using jQuery mobile 1.1.1 and jQuery 1.8.0
Add two pages to the project with header and footer regions using data-role="header"
Add data-id="test-footer" data-position="fixed" to the data-role footer element
Add a navbar list data-role="navbar" inside the footer and add list items with links to the two pages
Load the page and navigate between the two pages.
For more info see the JSBin example above.
Expected outcome
The fixed footer should stay in place while the page transitions behind it. Once the transition is complete, the target page should be rendered.
Actual outcome
The fixed footer stays in place, and the transition happens, but during the transition, extra text elements are added to the page.
Query Mobile version
Mobile: 1.1.1
jQuery: 1.8.0
Browsers/platforms tested
Problem in:
Webkit:
Safari 5.0
Safari iOS 5.1
Does not occur in:
Firefox 8.0
The text was updated successfully, but these errors were encountered:
Issue description
When using jQuery 1.8.0, in a site with a persistent footer toolbar containing a navbar, and no persistent header, extra text elements containing zeroes are being added to the end of the DOM whenever the page is changed through the footer navbar. This issue does not exist with jQuery 1.7.2
Persistent footer docs:
http://jquerymobile.com/demos/1.1.1/docs/toolbars/footer-persist-a.html
I've traced the problem to the file js/widgets/fixedToolbar.js, line 155:
https://github.com/jquery/jquery-mobile/blob/master/js/widgets/fixedToolbar.js#L155
At this point, if there is no persistent header, the variable nextHeader has a value of 0. On line 159,
nextFooter.add( nextHeader )
produces an array containing the footer jQ object and a value of zero. In jQuery 1.7.2, when appended to the document, the 0 is ignored. in jQuery 1.8.0, it is added as a text element.It could be argued this is a bug with jQuery, but it seems like there might be a line missing which would fix this very easily. We already assign nextFooter to an empty jQ object if it is blank, so we could add the same for nextHeader after line 155:
nextHeader = nextHeader || $();
So the code would look like
Sample page using the jsbin template which uses latest code
http://jsbin.com/orucec/111/
Use the footer tabs in the output window to switch pages. Notice zeroes being added to the document. Uncomment the jQuery 1.7.2 script tag in the HTML header and remove the jQuery 1.8.0 script tag. Try the tabs again. The problem no longer occurs.
Steps to reproduce
data-role="header"
data-id="test-footer" data-position="fixed"
to the data-role footer elementdata-role="navbar"
inside the footer and add list items with links to the two pagesFor more info see the JSBin example above.
Expected outcome
The fixed footer should stay in place while the page transitions behind it. Once the transition is complete, the target page should be rendered.
Actual outcome
The fixed footer stays in place, and the transition happens, but during the transition, extra text elements are added to the page.
Query Mobile version
Mobile: 1.1.1
jQuery: 1.8.0
Browsers/platforms tested
Problem in:
Webkit:
Does not occur in:
The text was updated successfully, but these errors were encountered: