Live data from Hacker News

Make Better Select Boxes with Chosen

harvesthq.github.com

31–40 of 89 posts

Re: Make Better Select Boxes with Chosen

#31
post #28

Sorry but this experience is badly broken in iOS and highlights yet again why native controls are always preferable over custom controls for compatibility. Also, don't forget about enabling accessibility by using ARIA.

Similar on Android; the widget behaves perfectly, which is ironically a poor experience on mobile.

Looks like it would be very nice on a desktop though!

Re: Make Better Select Boxes with Chosen

#33
post #29

We've been using this for what feels like 9 months with Picplum. One thing we did is for on select menus with few items, we hide the search box: $(".recipient_relation").chosen disable_search_threshold: 10 And if in Backbone you'd like to have it preselect the value, run something like this after render (so you don't have to add much logic to your handlebar template for the markup): @$("#address_country_field option"…

FYI, I had to go finding this the other day - it's tricky as mousing out removes the class. Anyway, it's: .chzn-container .chzn-results .highlighted

Yeah I remember hunting that as well some time ago

Re: Make Better Select Boxes with Chosen

#38

We've been using this for what feels like 9 months with Picplum. One thing we did is for on select menus with few items, we hide the search box: $(".recipient_relation").chosen disable_search_threshold: 10 And if in Backbone you'd like to have it preselect the value, run something like this after render (so you don't have to add much logic to your handlebar template for the markup): @$("#address_country_field option"…

Is the element you are binding chosen to visible from the start? I'm finding that chosen does not like to be bound to an element until it is visible.

I tend to do a lot of setup on render of fields that are hidden and displayed later in the same view, but chosen throws an error on 'searchfield[0]'.

Re: Make Better Select Boxes with Chosen

#40
The project "rationale" has a lot of holes in it.

> Instead of forcing your users to scroll through a giant list of items, they can just start typing the name of the item they were looking for.

Who's forcing? Modern browsers allow a user to type (in lowercase) text to find in a select element while focused and will scroll to an exact match inside of it. It would require some instructions, but deviations of that behavior have been around for a while.

> Because chosen replaces normal html select fields, you don't need to do anything special to make it work for browsers without JavaScript.

One definitely needs to do "something special" to make them work. Limiting options to massively bloated libraries like jQuery and Prototype is a big problem, especially for graceful degradation (impossible with both).

I'd be interested in something that works without a DOM library (definitely not impossible). Support beyond IE 8 would be a great idea as well.

Post reply on HN