Live data from Hacker News

Select2 - A better way to make select boxes (with jQuery)

github.com

31–40 of 60 posts

Re: Select2 - A better way to make select boxes (with jQuery)

#31
Feature request (I might add it to the github issues later, but I don't have time right now to do it justice):

I almost never, ever use a mouse (MacBook Pro's trackpad is the best pointing device I've ever encountered), but when I do, I usually select thing with ONE click of the mouse, instead of two (I'm lazy). For example, if I want to select 'Print...' under 'File' menu, I I move the cursor to the 'File' menu, hold left (or right, if I want to use something off a contextual menu) mouse button down, move the cursor down and over 'Print...' and let go of it. It's much faster I think, and I'm used to it. It's useful specially when you have to right click on something and then select an item with the left button.

The old, naïve `select`s all behave as expected (as they're usually native UI elements), but this `select2 ` thing does not work like this.

Re: Select2 - A better way to make select boxes (with jQuery)

#32
post #29

Earlier quoted context omitted.

Ah, it does on the computer. On the iPad and iPhone, it does not for some reason.

It's a one line fix, just the developer listening for a mousedown and not a touchstart event. https://github.com/ivaynberg/select2/issues/77

Ah, that'll do it. Listening for a click event should work for both, no?

Re: Select2 - A better way to make select boxes (with jQuery)

#33
post #13

It breaks normal usage. Tab to a normal Select, press 'n' 3 times and you get New Hampshire (the 3rd item starting with 'n'). Tab to Select2 press 'n' 3 times and you get nothing.

In Firefox on OS X most of the Select2 inputs don't seem to be in the tab order at all, they get skipped over. If I do have one selected and type "new" I expect to see "new hampshire" (or something else starting with new), but it drops the first character, opens the drop down and I have "ew" in the text field.

Re: Select2 - A better way to make select boxes (with jQuery)

#34
post #23

Obligatory: what's the difference between Select2 and Chosen? ( http://news.ycombinator.com/item?id=4074501 )

The biggest thing here is the AJAX loading of data. Like I said in that submission, Chosen really chokes if you have thousands of items in it.

Thousands of items arguably don't belong in a combobox, they should probably be split by letter, country, prefix, etc.

Re: Select2 - A better way to make select boxes (with jQuery)

#35
post #29

Earlier quoted context omitted.

It's a one line fix, just the developer listening for a mousedown and not a touchstart event. https://github.com/ivaynberg/select2/issues/77

Ah, that'll do it. Listening for a click event should work for both, no?

A mouse is not a finger ;)

Re: Select2 - A better way to make select boxes (with jQuery)

#37
post #13

It breaks normal usage. Tab to a normal Select, press 'n' 3 times and you get New Hampshire (the 3rd item starting with 'n'). Tab to Select2 press 'n' 3 times and you get nothing.

Hey, twitter did it with Bootstrap. Javascript is the assembly of the internet so lets get busy re-inventing and then breaking every wheel known to man.

Re: Select2 - A better way to make select boxes (with jQuery)

#39

At the time jQuery widgets like this and Bootstrap CSS seems to be the best platform for frontend development.

or at least newest. As someone who has tried to integrate Bootstrap into the UI of an existing product I'd say only helps if you don't have a designer. The number of bugs and the amount of code you end up having to deal with isn't worth it in the cases where a native element would have performed better.

Re: Select2 - A better way to make select boxes (with jQuery)

#40
post #30
post #13

It breaks normal usage. Tab to a normal Select, press 'n' 3 times and you get New Hampshire (the 3rd item starting with 'n'). Tab to Select2 press 'n' 3 times and you get nothing.

It also breaks two OSX defaults: - spacebar on a highlighted item should select it - the select menu should open on mousedown, not mouseup. Otherwise, it's a very nice piece of work.

Maintaining compatibility with existing keyboard UI should be considered essential for accessibility. And I haven't bothered to check compatibility with ARIA.
Post reply on HN