-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Focus after select not focusing #11
Comments
This one's on me. A breaking change in I think the fix would be to bind to the <Search
{...$$restProps}
- bind:this={searchRef}
+ bind:ref={searchRef} |
When focus after select enabled the hide dropdown should not be called:
svelte-typeahead/src/Typeahead.svelte Line 84 in ecbbfa6
Before the fix it wasn't called because the |
Yes, it's intentional to hide the dropdown after selecting or a result or blurring the input. |
But with getting the input focused again it should open again (or just not got closed). Now when having |
Maybe just changing the order would be the solution. Then all events will get called and the resultset will stay open as expected:
|
from a UX perspective, Id prefer the dropdown to be closed after searching and selecting a result. |
I totally agree when I understood Typeahead more as a search, than an input field, what was the reason for introducing Here is a sample with select_closing.mp4Compared to: select_staying.mp4The video is made on the code of this pr without the user styling applied: #13 |
When I do
focusAfterSelect='true'
the search results stay open after an selection, but the input doesn't get focus. I have to select it with the mouse to change the text in it.The console error says
TypeError: searchRef.focus is not a function
.I wasnt able to get the input focused, but the error message can be removed by changing
to
The text was updated successfully, but these errors were encountered: