Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Navbar displays active items wrong after navigation #5864

Closed
polarfish opened this issue Apr 8, 2013 · 4 comments
Closed

Navbar displays active items wrong after navigation #5864

polarfish opened this issue Apr 8, 2013 · 4 comments

Comments

@polarfish
Copy link

Issue description

Tho pages, with footer and navbar each. Navbars have two items both. Page №1 has first navbar item active and second one is pointing to page №2. Page №2 has second navbar item active and first one is pointing to page №1 respectively. After navigating between two pages forth and back navbar active items must be highlighted correctly.

Test page

http://jsbin.com/upiroy/1 First page
http://jsbin.com/axuxap/1 Second page
NB No difference which page you start navigation from

Steps to reproduce

Open any page from "Test page" section
Click to inactive navbar item (navigation to next page)
Click to inactive navbar item on this page (navigation back to previous page)

Expected outcome

The page you start navigation from must show proper navbar item highlighted

Actual outcome

None of navbar items are highlighted

Platforms/browsers (including version) and devices tested

Chrome 26, Ubuntu 12.10

jQuery Mobile and jQuery core version used

JQM - latest
JQ - 1.9.0

Other relevant information

It works fine in case of using JQM 1.2.0 instead of latest one. Actually I found it in JQM 1.3.0

@jaspermdegroot
Copy link
Contributor

@polarfish

You have to add class ui-state-persist as well. See the navbar API documentation: http://api.jquerymobile.com/navbar/

Closing as not a bug.

@polarfish
Copy link
Author

I know about ui-state-persist but it's another case - what if user wants to use navbar as a radio buttons group?
Here is an example:
http://jsbin.com/icetew/1 (Page №1)
http://jsbin.com/ekufem/1 (Page №2)

Steps to reproduce the bug:

  1. Open http://jsbin.com/icetew/1
  2. Click "Option 1 ..." in footer
  3. Click "I perform navigation to Page №2" link
  4. Click "I perform navigation to Page №1" link

Expected result: "Option 1 ..." still active (it behaves such way in JQM 1.2.0)
Actual result: None of options (navbar items) are active

@jaspermdegroot
Copy link
Contributor

@polarfish

The reason this doesn't work anymore is that we fixed #1181. The navbar widget is not designed to be used as a radio buttons group to set options. You can use the checkboxradio widget for this.

@polarfish
Copy link
Author

Thank you for clarification

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants