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

Clicks and touches on a touchable desktop #1

Open
evs-chris opened this issue Jan 27, 2016 · 4 comments
Open

Clicks and touches on a touchable desktop #1

evs-chris opened this issue Jan 27, 2016 · 4 comments

Comments

@evs-chris
Copy link

I meant to report this a week or three ago, but on my surface, which is touchable, the select doesn't work because it switched to mobile mode where there is no browser handled popover select thing for desktop browsers. I don't know of a good way to detect mobile vs touchable desktop, hence no PR 😞

@JonDum
Copy link
Owner

JonDum commented Jan 27, 2016

Oh hmm I definitely forgot about that class of devices. It's only using some rudimentary touch detection to try and open a real for phones since that's a way better UX. I can think of two solutions. Add a screen size check. If it's a touch screen but also huge, then just use the simulated select and let the author ensure the css makes it big enough to click. resort to user-agent sniffing for surface's to return false in isTouchDevice(). Other desktop's-that-are-also-touch-screens will have the same problem then

@evs-chris
Copy link
Author

If agent sniffing is in the mix, you could sniff for mobiles e.g. if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { /* touchy */ } as helpfully lifted from the nearest stackoverflow issue on detecting mobile browsers.

@JonDum
Copy link
Owner

JonDum commented Feb 3, 2016

So I added a small screen.width < 1200 for now. It's a terrible solution until I can figure out how to detect whether or not there's a proper native implementation on the browser.

@evs-chris
Copy link
Author

Eeeesh I had no idea...

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

2 participants