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

Hover is not working in Chrome Version 47.0.2526.80 m #141

Open
Itumac opened this issue Dec 15, 2015 · 6 comments
Open

Hover is not working in Chrome Version 47.0.2526.80 m #141

Itumac opened this issue Dec 15, 2015 · 6 comments

Comments

@Itumac
Copy link

Itumac commented Dec 15, 2015

Try your demo page in Chrome 47.0.2526.80 m
https://cameronspear.com/demos/bootstrap-hover-dropdown/

There are no console errors.
It works as expected in IE 11

@Itumac
Copy link
Author

Itumac commented Dec 15, 2015

It appears the ontouchstart catch in the init function is getting called in (this version?) of chrome.

if('ontouchstart' in document) return this;

@CWSpear
Copy link
Collaborator

CWSpear commented Dec 15, 2015

It works for me. I assume you're on Windows? Is your computer touch-enabled? This may be related to the infamous #68

@CWSpear
Copy link
Collaborator

CWSpear commented Dec 15, 2015

I guess that doesn't make sense if it works in IE11...

@Itumac
Copy link
Author

Itumac commented Dec 15, 2015

I'm on Windows 7 enterprise. No special machine. Suspiciously like #68

I changed the line to

if(window.DocumentTouch && document instanceof DocumentTouch) return this;

as found on SO. hover work in chrome and in tap in the mobile emulation mode. But its early moments of testing.

@whitneyland
Copy link

Here's why this is broken: Chrome has started supporting ontouch events in all versions of the browser so the existing check for mobile does not work anymore and always returns true (if('ontouchstart' in document) return this;).

The reason Chrome can do this is because the CSS working group standardized media queries as the proper way to detect this. All the latest browser versions now support this standard.

For more information, this is how it should be properly done now:
https://drafts.csswg.org/mediaqueries-4/#mf-interaction

@stormisover
Copy link

Also met the some issue. If this plugin does not work well on mobile browser, I suggest detecting the device type by navigator.userAgent.

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

No branches or pull requests

4 participants