reactjs / react-autocomplete

WAI-ARIA compliant React autocomplete (combobox) component
MIT License
2.17k stars 532 forks source link

Autoselect (focus lost) #251

Closed matiwinnetou closed 7 years ago

matiwinnetou commented 7 years ago

For our usecase we actually need that blur or focuslost causes the value in dropdown to be preselected when user leaves the field.

The idea is that some users when item is highlighted may think it is preselected.

serhii-shvaher commented 7 years ago

Totally agree! We have the same use case. Would be awesome to add new feature under prop autoSelect. I would like to make contribution with this new feature.

CMTegner commented 7 years ago

For our usecase we actually need that blur or focuslost causes the value in dropdown to be preselected when user leaves the field.

Is this for when the user navigates between input elements by using Tab, or for when they click outside the input? The former has already been proposed and will likely be implemented in v2, but the latter seems like very confusing behaviour to me. A good UX benchmark is to look at how the native <select> element behaves in similar situations.

The idea is that some users when item is highlighted may think it is preselected.

Is this a theory you have, or have you proven it through user testing?

matiwinnetou commented 7 years ago

We have proven it via A/B testing. We had a few variants, this one performed the best.

You can play with old jQuery component which we are rewriting now on our page and you can see that it is currently selecting items on focus lost (both tab and click out).

image

https://suchen.mobile.de/fahrzeuge/search.html?lang=en

CMTegner commented 7 years ago

Closed via #252. Thanks for the work!