-
-
Notifications
You must be signed in to change notification settings - Fork 299
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
[Autocomplete] tom_select_options closeAfterSelect losing search term after selecting two items #595
Comments
It looks like we manually clear the box after selecting an item: https://github.com/symfony/ux/blob/2.x/src/Autocomplete/assets/src/controller.ts#L85 If you set a Why do we have that line? I wrote that code, but I have no idea why I included that. I borrowed the code from EasyAdmin, but they don't have this code. In many cases, it make sense: you type in a few characters, select an option, and now you want to start fresh again, without needing to delete the characters you already have. So, I'm a bit mixed on what to do. |
Thanks for the fast reply and I can confirm, that the workaround works for me. I am also not sure, about what would be the better default behaviour. In the app, where the users reported that behaviour to me, they obviously are often searching for items with similar names and do not want to re-enter the name after adding two items. But I guess (after thinking about it for a while) in most use-cases the users want the default behaviour to be as it is right now. So maybe leave it as it is, but document the option somewhere? Anyway, thanks for your reply and offering a workaround. |
Thanks for confirming that! Yea, right now, I'm thinking we should document this. The current code is a little bit opinionated, but if it's easy to change it, I think that's ok. Unless we hear from a bunch of people that think removing the current behavior would be a better default. |
Thank you for this issue. |
Friendly reminder that this issue exists. If I don't hear anything I'll close this. |
Well, it is still not documented is the docs of Symfony UX Autocomplete , but nobody seems to care about the default behavior :) But on the other hand, it still would be great for anybody who does not want the box cleared after an item is added, to directly be able how to get that in the docs. |
Hello everybody,
I think I noticed a little bug when using Autocomplete when 'multiple' is set to true in combination with the tom-select-option 'closeAfterSelect' set to false.
When you enter a serch term into the input field, you see a list with all matching items (as expected), but after you select two of them, the entered search term is missing and you have to reenter the search term.
First I thought that is because of something being strange, misconfigured or not up to date in the project where a customer reported that behaviour.
So I just started a brand-new Symfony 6.2 project only for the purpose of reproducing that behaviour and it is the same in the new project.
Here is the TestType form I created:
And here you can see what happens:
edit: mardown and example.gif somehow do not work. I am sorry :(
The text was updated successfully, but these errors were encountered: