When $.mobile.ajaxEnabled === false, $.mobile.activeBtnClass won't be removed from the clicked link after page transition is completed. Related code seems to be jquery.mobile.navigation.js.
As far as I know, $.mobile.activeBtnClass is added to the link in the vclick event handler and is removed after the page transition in the removeActiveLinkClass that requires $activeClickedLink to be set properly.
The $activeClickedLink is set in the click event handler at L1093, which is unreachable when $.mobile.ajaxEnabled === false since it's after if statement at L1041.
To my thinking, fundamental solution is to move the line to set $activeClickedLink just before the if statement.
Current adhoc solution is writing code like:
That worked like a charm.
Oh, I should mention I was having the same issue with ajaxEnabled == true.
Here's the details of the issue as I see it:
Page1 loads, user clicks on link to page2
on Page2 in the pageShow event, the user is conditionally directed to Page3. This is done by calling the anchors click function to simulate the user clicking the default option on the page. Doing this in the pageShow event messes up the active link tracking.
A related issue is that if Ajax is enabled, if you click a button or listview item, it gets the active state. If Ajax is slow, you can click other items and they all get the active state so it feel broken. We should clear all other active states and kill the older requests (ignore 'em).
@toddparker did you mean killing the ajax requests or just the visual state?
Fix for issue #2017. Clear active link on vclick so there can be only…
… one active link at a time.
@gseguin - The visual feedback for sure, but if i click 3 list items, i think we should transition to the latest click and just ignore the earlier requests. That part may be hard but the visual bit is at least a good first step. Looks very broken on slow connections if we have multiple active states.