9 ms·
Chosen: A javascript plug-in that makes long select boxes user-friendly.
- ww520 15y agoThis is fantastic. ComboBox is what's missing in HTML. This is a keeper.
- dave1010uk 15y agoHTML5 has the datalist element, which provides suggestions for an input box and is similar to a combo box. The best info I can find on it is: http://dev.opera.com/articles/view/an-html5-style-google-suggest/ http://dev.opera.com/articles/view/an-html5-style-google-sug... This is currently only supported by Firefox Opera. A JavaScript polyfill to get this working in other browsers would be great.
- hendrik-xdest 15y agoBest plug-in of the year, so far. Apart from what it says, I do not see problems in IE7 or IE8 (there is some style issues in IE9, though). Also, it is nearly working in IE6. I think I'll try to diddle around with some z-index and CSS stuff to get it working. Can't be much more than that.
- Joeboy 15y agoWhat's the nature of the nonworkingness on the dodgy browsers? Does it fail catastrophically or degrade satisfactorily? If you manage to fix it for other browsers I hope you push your fixes upstream.
- hendrik-xdest 15y agoIt looks to me as if there is a z-index problem and the position is not upheld correctly in IE6. In IE9 there is a difference in the linear gradient color. No catastrophes there, imho.
- skrebbel 15y agoExcellent. Makes you wonder why browser vendors never improved on the usability of such controls themselves.
- dave1010uk 15y agoSome do. Maemo's MicroB browser shows this when you click on a select menu: http://i.imgur.com/rP6Mz.png http://i.imgur.com/rP6Mz.png - one of the few places interacting with a website is actually easier and faster on a mobile than on a desktop browser. I think Nokia's Symbian devices do this too.
- bilban 15y agoI'd rather my OS (desktop theme) be left to take care of the controls, which at least lends to better consistency than a myriad of different browser and site implementations.
- thristian 15y agoApparently Chosen takes the placeholder text from the select element's 'title' attribute; does it also support the official HTML5 syntax[1] for placeholder attributes in select elements? How about integration with jQueryUI's theming system? [1]: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#placeholder-label-option http://www.whatwg.org/specs/web-apps/current-work/multipage/...
- philfreo 15y agoIt'd be better if it looked for the HTML5 "placeholder" attribute even in older browsers rather than having to use "title" also. Some JS plugins [1] do this to replicate placeholder support in older browsers and I don't think there's any downside. [1] https://github.com/mathiasbynens/Placeholder-jQuery-Plugin https://github.com/mathiasbynens/Placeholder-jQuery-Plugin
- edoloughlin 15y agodoes it also support the official HTML5 syntax[1] for placeholder attributes in select elements? I'd be impressed if it does. I can't parse that sentence in the spec.
- thristian 15y agoThe markup it describes is basically: <select required> <option value="">Placeholder Text Here</option> <option value="1">first real option</option> </select> The rest of the text basically says that select elements that are not required don't have placeholder text; that select elements that allow multiple selections don't have placeholder text; multi-line select elements don't have placeholder text, and that if the first option is inside an optgroup element, it doesn't count as placeholder text.
- gorm 15y agoDoes anyone know if it's compatible with formalize.me? Does it work well on android/iphone?
- marquis 15y agoWorks well on Android 2.1 for me here. Beautiful plugin, bookmarking for definite future use.
- dspillett 15y agoSeems OK on the default Android browser here too, though there are a couple of non-breaking issues under Opera Mobile.
- KevinKaske 15y agoTechnically it works ok on the iPhone. From a UX standpoint it's not that good. It's completely different from a native iPhone drop down control. I don't know that there is anything that the developer can really do about it. IMHO I would use a JavaScript check to make sure that mobile clients use the native controls and everyone else uses this plugin.
- pilif 15y agoAnd yet another control that pretends to be a dropdown box, but isn't. No. I'm not complaining about the appearance or the fact that it has a search field while the real dropdown doesn't. I'm complaining about the way it responds to mouse actions: The real dropdown box, on my machine, expands the menu on mouse down after a no-doubt OS-specific delay. The fake dropdown doesn't - it only reacts on mouse up. Of course, you can't make a a control work exactly like its native counterpart - but that IMHO just means that you shouldn't even try imitating them and provide its own unique look. I really dislike nearly-native controls - they feel wrong to me. But don't get me wrong: The controls are really cool and incredibly useful. If only they didn't try to mimic the native look without quite matching it.
- deleted 15y ago[deleted]
- systemizer 15y agoMy problem with this is that when I see the box (e.g. Multiple Select), I perceive it as a text input. I'd be ill-surprised to discover on a site to (all of a sudden) have this protruding box appear out of nowhere. Better solution: on mouse click, hide the box. Only show the box for autocompletes.
- camiller 15y agoWhen we do this (with jQueryUI) we add the little down arrow button decoration so you expect the dropdown to appear.
- jscheel 15y agoHmm, it definitely is a learned experience. Some form of affordance here would really help clarify what will happen. You could add some placeholder text that says something like "click to add items", but that seems a bit like "turn knob to open door."
- benatkin 15y agoI agree it's not ideal, but I think the majority of users have seen less friendly versions of this. The concept is Token Input. Facebook uses it in places, and they don't have the placeholder text that says "Choose..." when nothing is selected. I think the placeholder text ought to help quite a bit.
- geuis 15y agoThis nearly completely breaks the select ui on iOS. It should do some kind of feature detection so that it can disable itself on browsers that have alternate ui's for controls like this. For example, this converts a select menu to an input field. On iOS the keyboard comes up instead of the select control.
- gpambrozio 15y agoDidn't test on the iphone but on the ipad if you expand one control and then click on another it will keep both expanded. Click on a third and now you'll have 3 expanded. Looks weird. Also, +1 to try to replicate the native look, maybe just adding a down arrow. Good job otherwise.
- powrtoch 15y agoThis just seems like a matter of preference to me. It works on iOS pretty much just like it works on a desktop. It may be that some iOS users would prefer the native UI, but you could say the same for some desktop users (particularly keyboard-wary ones). I certainly wouldn't call anything "broken".
- philfreo 15y agoIt's broken. When I tapped it the element the dropdown part of it didn't come up on the screen. The only way to scroll inside it is to do the 2 finger scroll, which 90% of users wouldn't know how to do (since normally you do a 1 finger). On the desktop the element still feels like a <select>. On the iPhone it feels nothing at all like a <select>
- richbradshaw 15y agoI believe that on iOS5, the 2 finger scroll has been removed and replaced with a 1 finger one.
- arctangent 15y agoAwesome. This is going into my UI toolkit.
- philfreo 15y agoThis project looks awesome. This stuff is annoying to have to replicate yourself, and I'm glad to see MooTools support as well. That said, my first reaction when looking at the first Country dropdown example was that I liked the native one better since in OS X it shows me dozens of choices at once (fills most of the screen vertically) and then in the "after" suddenly I was constrained to only seeing 7 countries at a time. Not a huge deal but felt like a loss in usability (but a gain visually). If the faux dropdown was just a little taller in height it'd be better. Secondly, this just killed iPhone support. Apple did a good job with <select>s on iOS and this completely breaks it. It should just turn itself off on iOS.
- jsavimbi 15y ago> Apple did a good job with <select>s on iOS and this completely breaks it. Agreed. Also, when a user has to access both your desktop and mobile apps, the experience has to be the same. This plugin, however nice, is trying to solve a problem by further modifying the problematic feature. Just remove the select if your list is too long; there should really only be a handful of options contained within. As a rule, I keep it to five and I never replace the pseudo element with plugins.
- smunz 15y agoInteresting statement! What would you suggest as a replacment for long option lists? Autocomplete?
- jsavimbi 15y agoNo, there is no conventional standard for auto-complete and you would have to be able to determine whether or not the user was actually trying to employ a/c functionality versus typing a term that they've already brought to the forefront of their action. Auto-complete interrupts this mental workflow and affects the UX in a negative manner. It's like continuously prompting a person who has difficulty with stuttering. After awhile they'll find you too difficult to talk to and go back to drinking beer and watching TV. One aside is the convention of time/date/location that you'll find everywhere. For whatever reason someone needs to capture the information from the Andorrans to the inhabitants of Wallis and Futuna. I can't fight people that include over 200 options for countries and territories when this info could be ascertained and captured via other methods, but people already have a mental map of where their options are in these lists, so if you really need to, then go ahead. iOS has the best solution for this. Also, a select is a part of CRUD, so please don't use it for navigation. The solution that I like to employ is an unordered HTML list, with the items bricked in equal size, separated uniformly right and bottom and floated left. You can see this when you look at Google+'s circles. The user knows to read from left to right (assuming western conventions) and can navigate top to bottom with the ease of the mouse without making commitments. I currently do this with a list of ~250 options and employ ajaxy magic to capture the user's actions. I assist the user by alphabetizing the list so that they'll be able to mentally map their position as well as curated and separately displaying the most popular option at the top of the list, much like US-based website will do when displaying "United States" as the first option in their select. If displaying on a mobile device, I would recommend displaying in a one-column list; if a user can navigate Twitter, they'll have no problem with scrolling down to find their selection because they've already been trained to do so and it'll come as second nature. (which is why is good practice to adopt conventions from popular applications. Why fight it?) Another option that I've found helpful i to employ pathways when too many options with similar names can cloud the user's mental map. It's ok to break up a form into logical step-by-step pieces. You gain the user's trust by preempting tedious actions. Intersticial pages, not pop-ups, are ok if the user understands where you are taking them and for the tricky parts, some reassuring copy can do the trick. People read; just go through Amazon's checkout process a couple of times over the course of a week. You may forget a step, but they're right there to help you without employing navigation or CRUD devices on the screen. tl;dr: just put the options in a list as ajax buttons or checkbox-activated text. Keep it simple and organized and don't play hide and go seek with the user.
- tomelders 15y agoThis plugin makes the case that this sort of functionality should be implemented into browsers very well.
- piquadrat 15y agoSo... why don't they use this thing on their own web app? The "Project / Task" select box becomes very unwieldy with a growing client base. I spend way too much time looking for the correct project almost every time I have to create a new entry.
- whacker 15y agoBecause the plugin is written by a github user, not github themselves.
- bane 15y agoHopefully some of these ideas will end up in dojo/dijit (a couple similar takes are already there). I really like the multi-select control.
- PhrosTT 15y agoI've been using the jQuery UI ComboBox for a while, it's essentially this. - http://jqueryui.com/demos/autocomplete/combobox.html http://jqueryui.com/demos/autocomplete/combobox.html
- fooyc 15y agoThe UI widgets like this all have the same defects: 1. They are slow, as all their markup has to be generated on the client side each time the page loads 2. They are not ajax friendly. I mean that if you insert a select box in a HTML document with javascript, it will remain a plain native select box unless your script specifically calls the right widget's function. So you have to update all your scripts. 3. They are not drop-in replacements for native widgets, all your script must know how to handle these widgets for things like getting the widget's value, listening for events, etc. Points 1 and 2 could be fixed by generating the widget's HTML code on the server side and using delegated events (like jQuery's delegate()). (Progressive Enhancement can still be achieved without doing _everything_ on the client side.) Other than that, the idea of a text input on the top of the options list is awesome.
- danberger 15y agoHas anyone tried this on an iPad?
- e98cuenc 15y agoI did it just now. The divs that contain the choices can only be scrolled with two fingers, a trick most users don't know about. The native select can be scrolled with only one finger.
- MaurizioPz 15y agoI think this is great and would like it to be a browser extension so that I can use it all over the web
- goo 15y agoThat looked like a cool project, so here: https://github.com/gk777/Easy-List-Select https://github.com/gk777/Easy-List-Select Unfortunately, I don't think it's as good as I thought it would turn out to be, but it's definitely neat. EDIT: it's a chrome extension BTW
- shawndumas 15y agoNote: IE8 (and lower) support is done via Chrome Frame.
- SolarUpNote 15y agoI love this. LOVE it!
- exch 15y agoThe first sentence on the linked page has a typo: "javsacript"
- romaniv 15y agoThe more libs like this I see, the more I feel that the core HTML controls should be improved and expanded. They are getting really, really dated and don't address a lot of common problems. Things I feel would make a lot of sense: Collapsible trees. Numeric sliders (preferably done like draggable digits http://worrydream.com/Tangle/ http://worrydream.com/Tangle/). Native drag-and-drop sipport for elements. (And yes, this can be done with plain forms. I can explain how if you want.) Native rich tooltips and a standard notation to show that something has a tooltip. Maybe tabs. I think you could do tabs with CSS, but I'm not 100% sure. If most UI libraries have something, it probably would be a good addtion to HTML spec. It would work faster and eventually have better compatibility.
- xutopia 15y agoNumeric slider exists in HTML5: http://diveintohtml5.org/examples/input-type-range.html http://diveintohtml5.org/examples/input-type-range.html
- mickeyben 15y agoFor the multiple select, I like this one a lot: http://loudev.com/ http://loudev.com/ It's way simpler for the average user.
- koblas 15y agoI think it's pretty cool, though it would be nice if they had a simplified single selection version. Which is to change a single select list into a text field with "instant search". The current incarnation make me first go for the pull down rather than just tabbing over and start typing.
- nerdo 15y agoMulti-select could use some work. Drag-highlighting, shift, ctrl, etc.
- andos 15y agoWriting good widgets from scratch is an endless task. It's missing ARIA roles: http://www.w3.org/TR/wai-aria/roles#combobox http://www.w3.org/TR/wai-aria/roles#combobox
- martin1b 15y agoWow. The results are really polished!
- naeem 15y agoSexy! I do agree with a previous comment that the more technologies like these that come out, the more apparant it becomes that HTML as a whole needs a long overdue makeover.
- d0m 15y agoI would also add a fuzzy matching. I.e. "unitd sta" should match "United States" even with the missing "e". Or "East coast" should match "The East Coast".
- Inufu 15y agoUm, what use this? If I click on a dropdown box, I can already type the value on my keyboard to select it. No javascript necessary. (using chromium on ubuntu)
- InclinedPlane 15y agoLove it! Sure it's not perfect, but it's a huge improvement already. I've had similar ideas myself but haven't gotten around to implementing them. The existing HTML input controls are clunky and haven't kept up with the pace of web development, maybe we can improve on them using CSS & JS until we develop a new set of canonical input primitives that then become standardized.
- myworkipad 15y agoOn the iPad, the custom control is decidedly worse. The native one is larger and more appropriate for the device. This idea of custom UI elements seems really bad. It's gonna be worse than native on any platform. The issues with native controls should be addressed on their respective platforms.