mousemke / flounder

Style-able dropdown replacement for native dropdowns
MIT License
9 stars 10 forks source link

[Events] Up and down keys on search not working #194

Open conor-cafferkey-sociomantic opened 6 years ago

conor-cafferkey-sociomantic commented 6 years ago

Currently

Pressing the up and down keys changes the selected value in the dropdown. But this is not working when search is enabled.

Wanted

Pressing the up and down keys should always change the ~selected~ focused value (and Enter selects it).

Notes

This is a regression of #50

Related

mousemke commented 6 years ago

iirc this was intentional behavior. while typing, you dont want the input to lose focus due to accidentally pressing up/down. also, native behavior in an input would be focussing to the beginning and end og the field w/ up/down

conor-cafferkey-sociomantic commented 6 years ago

Hmm intentional or not I think it can be improved 🙂

while typing, you dont want the input to lose focus due to accidentally pressing up/down.

The thing is, the input should always retain the focus: the options just receive a “hovered” styling, don’t actually get focused. (This is implemented in the commit above.)

native behavior in an input would be focussing to the beginning and end og the field w/ up/down

True, but in this case we’re not talking about a simple input. What we have here is more like a combobox. HTML doesn’t have that concept so there isn’t really a native behavior to speak of but if you bring up (for example) the macOS Spotlight Search you can see the native behavior of the arrows there.