Chosen: Chosen dropdown scroll doesn't work for touch device

Created on 4 May 2016  ·  3Comments  ·  Source: harvesthq/chosen

I have Sony Z4 Tablet with Android 6.0 (Google Chrome 50). And I try to use chosen drop-down, but unfortunately it is impossible because I cannot use scroll for chosen drop-down: You can try to reproduce this bug here: https://harvesthq.github.io/chosen/.
You should remover condition:
if (/Mobile/i.test(window.navigator.userAgent)) {
return false;
}

from function "AbstractChosen.browser_is_supported"

Most helpful comment

There is a simple fix, in my case i have commented the following in register_observers

this.container.bind('touchstart.chosen', function(evt) {
_this.container_mousedown(evt);
// return evt.preventDefault();
});

in my case its working fine.

if anything wrong in that please suggest me

All 3 comments

I don't believe Chosen should be enabled on such a device.

What would removing that condition change?

There is a simple fix, in my case i have commented the following in register_observers

this.container.bind('touchstart.chosen', function(evt) {
_this.container_mousedown(evt);
// return evt.preventDefault();
});

in my case its working fine.

if anything wrong in that please suggest me

I agree with @koenpunt that Chosen should be disabled on mobile out of the box. Personally, I don't feel like its UI is really an improvement over the built-in selects on Android and iOS. Select boxes on the desktop are so much worse...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gitmk picture gitmk  ·  47Comments

elneilios picture elneilios  ·  24Comments

MB34 picture MB34  ·  22Comments

pushinginertia picture pushinginertia  ·  80Comments

silkfire picture silkfire  ·  53Comments