Visual indication for autoselect
Hey,
Currently, all autoselect does is select the first suggestion when the user hits the enter button. I think the more natural behaviour would be to also "auto-cursor" it, because then the outcome is actually expected.
I found myself doing:
.on('autocomplete:shown', function (event) {
$(event.target)
.closest('.algolia-autocomplete')
.find('.aa-suggestion')
.first()
.addClass('aa-cursor');
})
Which ironically makes autoselect redundant, since even when disabled, the above code makes it autoselect. I'm guessing this is due to mutual reliance on .aa-cursor.
Apart of this redundancy, it just makes sense UI-wise, since right now autoselect looks visually the same, whether enabled or disabled.
Makes sense, but this would introduce a UX BC issue. What do you think @redox @vvo ?
Makes sense, but this would introduce a UX BC issue. What do you think @redox @vvo ?
I think that makes sense 👍 @legshooter any chance you could submit a PR?
I tried: https://github.com/algolia/autocomplete.js/pull/101
Merged and looks good. Thanks everyone, closing now.