pstanoev / simple-svelte-autocomplete

Simple Autocomplete / typeahead component for Svelte
http://simple-svelte-autocomplete.surge.sh/
MIT License
469 stars 79 forks source link

Shift+tab doesn't work to go to previous input #123

Closed justingolden21 closed 2 years ago

justingolden21 commented 2 years ago

Shift+tab should go backwards, but it doesn't do anything once you get to the top.

I also think tab and shift+tab shouldn't navigate menu options, which should only be arrow keys, if you examine similar inputs across the internet and look at some UX

Thank you : )

justingolden21 commented 2 years ago

I was also wondering (didn't want to keep opening tickets to avoid spamming your repo) if it's possible to get the input to autofocus on page load.

Also, what is the correct syntax for setting an onchange listener, such as on:change={() => console.log('hi')} EDIT: found it, it's onChange={() => console.log('hi')}. This should be documented somewhere, I see that both in readme and website a lot of documentation of what's possible is missing. handling onchange can be crucial for any reactive app.

justingolden21 commented 2 years ago

One more comment (sorry for the spam), but is there an option to select all text on click?

justingolden21 commented 2 years ago

None of my custom styles are being applied as well

<style lang="postcss">
    /* the main control */
    .autocomplete {
        background-color: green;
        border: 1px solid red;
    }
    /* the input list */
    .autocomplete-input {
        background-color: green;
        border: 1px solid red;
    }
    /* the dropdown list */
    .autocomplete-list {
        background-color: green;
        border: 1px solid red;
    }
    /* items in the dropdown list */
    .autocomplete-list-item {
        background-color: green;
        border: 1px solid red;
    }
</style>

I also found that removing bind:selectedItem in favor of selectedItem made my changes actually bind in my app funny enough. Just commenting this in case someone else has similar problem.

pstanoev commented 2 years ago

Fixed in version 2.3.2. Tab and Shift + Tab no longer move through items and the dropdown is closed.