Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

jquery mobile active state sticking after pressing links #12

Closed
spencerslickremix opened this issue Oct 4, 2012 · 18 comments
Closed

jquery mobile active state sticking after pressing links #12

spencerslickremix opened this issue Oct 4, 2012 · 18 comments
Assignees

Comments

@spencerslickremix
Copy link

I am using jquery mobile 1.1.1 and using latest version of fastclick.js and applying the js globally, The problem occurs when I tap on my menu items, they procede to next page (awesomely fast might I say, great job!) but then when I tap to go back the menu item becomes stuck in an active state, or visited state.

@mattcg
Copy link
Contributor

mattcg commented Oct 4, 2012

Thanks for reporting. Have you got an example I can look at?

@spencerslickremix
Copy link
Author

Ah forgot to mention most important parts I guess.

I'm using cordova 2.0/phonegap, and Xcode to compile this for an app on an iPad2 using OS6, so unfortunately I can't share the files. This problem does not happen when using a browser, only on the iPad2, not sure about other devices.

@spencerslickremix
Copy link
Author

It appears from this thread maybe the event is being fired twice, that is why the active state is sticking, this sorta matches becuase, if you tap that active button again when it's not on that page, the button with become inactive. Hope that makes sense. https://forum.jquery.com/topic/how-to-remove-the-300ms-delay-when-clicking-on-a-link-in-jquery-mobile

@mattcg
Copy link
Contributor

mattcg commented Oct 4, 2012

Thanks for the link, but it's difficult to know what you're talking about without seeing an example page.

@spencerslickremix
Copy link
Author

As I was saying it's an application, and when you view the html file everything works in the browser, just not on iPad. I could send you the zip of my application if you can run it?

@mattcg
Copy link
Contributor

mattcg commented Oct 4, 2012

That would be useful, thanks. My address is m@m.cg.

On 4 Oct 2012, at 06:39 PM, usmart notifications@github.com wrote:

As I was saying it's an application, and when you view the html file everything works in the browser, just not on iPad. I could send you the zip of my application if you can run it?


Reply to this email directly or view it on GitHub.

@ghost ghost assigned mattcg Oct 4, 2012
@spencerslickremix
Copy link
Author

Sent zip, just following up.

@mattcg
Copy link
Contributor

mattcg commented Oct 6, 2012

Haven't received the zip.

@spencerslickremix
Copy link
Author

I just sent again, check your junkmail it's about 6mb. Thanks again.

@mattcg
Copy link
Contributor

mattcg commented Oct 7, 2012

Still haven't got it. Will you try matt.cg@ft.com instead please?

@spencerslickremix
Copy link
Author

That email address bounced back.

@mattcg
Copy link
Contributor

mattcg commented Oct 7, 2012

Upload to Mediafire or something like that and send me the link?

@spencerslickremix
Copy link
Author

Hey thanks a ton for looking into this for me. Great job again!
Not sure how your gonna run it on your iPad without my provisioning and certificates but here it is:)

Takes a second to load but the problem does occur on the simulator too.
http://slickremix.com/ftk.zip

@mattcg
Copy link
Contributor

mattcg commented Oct 9, 2012

The issue is that jQuery Mobile's vclick event fires after the click event generated by FastClick. JQM uses vclick to add the active state to links because ordinarily it fires it after a touchend, like FastClick.

We can't fix this issue without massively hacking FastClick to send vlick events and compatibility with JQM is not a goal so I don't think we're going to do that. It would make more sense to get a more custom solution implemented for JQM.

@mattcg mattcg closed this as completed Oct 9, 2012
@spencerslickremix
Copy link
Author

Couldn't I somehow disable the vclick, i'm developing an app for IOS only.

@mattcg
Copy link
Contributor

mattcg commented Oct 9, 2012

I think you can just $(document).unbind('vclick') after JQM has initialised.

@spencerslickremix
Copy link
Author

Shaw you know what, I just updated to Final version of jquery.mobile-1.2.0.js and it's all good!

@AdrianBernal
Copy link

Hello, I found an alternative to fix the issue. $.mobile.activeBtnClass = "[any class that not exits, not null]";

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

No branches or pull requests

3 participants