oi.select icon indicating copy to clipboard operation
oi.select copied to clipboard

Open options on 'focus'

Open cklemming opened this issue 9 years ago • 4 comments

It seems only 'click' events trigger the drop-down options list to open. Is there a way to make this open on 'focus'?

It would make it neater when you tab through forms where you rely on the options.

cklemming avatar Sep 12 '15 23:09 cklemming

It works as native select — open list on click only. You can trigger click manually

tamtakoe avatar Sep 13 '15 17:09 tamtakoe

I tried calling click(event) from function focus(event).

While it does open the drop-down option, the drop-down automatically closes on hovering the mouse over it for some reason. Any idea why that behavior would happen?

I'll try troubleshooting on my end. Thanks.

cklemming avatar Sep 15 '15 23:09 cklemming

Thoughts on adding a custom option "openOnFocus=true/false"?

Given that the oi-select is a hybrid between a native select and a text field, being able to expand the list on focus is definitely a useful behavior. Especially on readonly fields, when you just want the user to select among the options.

cklemming avatar May 24 '16 14:05 cklemming

While I also think an openOnFocus option would be nice, I'm afraid there could be issues when "tabbing through" fields. E.g. pressing tab to jump to the next field and then unwantedly selecting an option by tab (for example on a previously blank field), which is very undesirable.

I'm working on a project where we are using selectize and that's exactly one of the issues (among others) we're having. This is also why I'm evaluating oi-select as an alternative... which is looking great so far.

You can also open the dropdown with arrow down BTW.

adlh avatar Jul 13 '16 07:07 adlh