Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On iOS7 $("ul.nav").find("li.active").removeClass("active").find("a").blur() leaves zombie menu item highlighted #10828

Closed
jeffschwartz opened this issue Sep 26, 2013 · 6 comments

Comments

@jeffschwartz
Copy link

On iOS7 browsers (I've tested with Safari and Chrome) the navbar is left with a zombie highlighted li element.

Please run the jsbin (link below) on both iPad/iOS7 Safari and Chrome. Also please read the comments in the javascript code. It explains the issue.

Link to jsbin:
http://jsbin.com/exOZAPu/9/edit?html,js

photo

@cvrebert
Copy link
Collaborator

I don't think this can reasonably be considered a bug in Bootstrap itself. This is either a browser bug, or your toggling JavaScript is missing some step (last time, you forgot to blur; maybe you need to likewise "un-hover" or something).
I would advise tweaking navbar.less so that the styles for .active, :focus, :hover, etc. use extremely different colors, which should help you to debug this.

@jeffschwartz
Copy link
Author

I know this issue has been closed and I think rightly so as I've determined through extensive googling the issue that
it isn't a bootstrap bug. The problem lies in mobile webkit based browsers and how it simulates hover (there is no real hover in a mobile browser since there is no mouse) in response to users 'touching' elements on a page.

I reported the issue to Apple and will have to wait for their response. In the meantime I fixed the issue using 'radical surgery', so to speak, by replacing all active li > a tags with span tags and using css styles for active and non active nav bar items and enforcing them by adding !important. I tested on iOS/iPad and it works. If anyone is interested you can view the fix live at http://coccyxjs.nodejitsu.com/.

In a way, replacing the active nav bar anchor tag with a span tag makes a lot of sense since there is no reason the user should be able to cause the 'page' to render again. Still, hoping that Apple will address the issue as I am sure that there are a lot of other developers out there whose single page web apps will eventually bump into this problem.

@cvrebert
Copy link
Collaborator

cvrebert commented Oct 2, 2013

@jeffschwartz Do you have the Radar number or bug tracker link available, so that interested parties can follow along?

@jeffschwartz
Copy link
Author

@cvrebert The ticket number is 15100108.

@cvrebert
Copy link
Collaborator

cvrebert commented Oct 7, 2013

X-Ref: #10968

@cvrebert
Copy link
Collaborator

Shameless plug: https://github.com/cvrebert/mq4-hover-hover-shim

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

2 participants