autocomplete icon indicating copy to clipboard operation
autocomplete copied to clipboard

Visual indication for autoselect

Open kobykorman opened this issue 10 years ago • 4 comments

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.

kobykorman avatar Jul 27 '16 20:07 kobykorman

Makes sense, but this would introduce a UX BC issue. What do you think @redox @vvo ?

rayrutjes avatar Jul 27 '16 21:07 rayrutjes

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?

redox avatar Jul 28 '16 07:07 redox

I tried: https://github.com/algolia/autocomplete.js/pull/101

kobykorman avatar Jul 28 '16 11:07 kobykorman

Merged and looks good. Thanks everyone, closing now.

kobykorman avatar Sep 02 '16 13:09 kobykorman