ux icon indicating copy to clipboard operation
ux copied to clipboard

[Autocomplete] Search is not triggered when "clearing" the select

Open lukepass opened this issue 2 years ago • 8 comments

Hello, when clearing the select after a search it's not possible to get all the elements (as it is when the select is opened the first time).

This causes that, after a search, you are "locked" with the elements starting with the string you just typed.

The only way to get this is to set "minCharacters" to 0 but this isn't always desiderable. IMHO it should be that, when the select is cleared, the load is triggered again.

Thanks.

lukepass avatar Oct 03 '23 13:10 lukepass

Hmm. The logic here - https://github.com/symfony/ux/blob/2.x/src/Autocomplete/assets/src/controller.ts#L192-L212 - looks like it SHOULD issue the query again if you empty input (and choices were previously loaded). Also, https://ux.symfony.com/autocomplete seems to be working as you mention. If I "clear" a query, it loads everything again. Unless the bad behavior is related to a "single" select only?

weaverryan avatar Oct 03 '23 16:10 weaverryan

Isn't minCharacterLength zero by default since minCharactersValue is 3 by default?

lukepass avatar Oct 04 '23 12:10 lukepass

Isn't minCharacterLength zero by default since minCharactersValue is 3 by default?

I think this is NOT true, unless I'm missing it. The docs say that 3 is default, but I think it's an "implicit" default: https://github.com/symfony/ux/blob/2.x/src/Autocomplete/assets/src/controller.ts#L211 if nothing is passed.

On https://ux.symfony.com/autocomplete I don't see a min-characters value being passed, which means minCharacterLength will be null.

weaverryan avatar Oct 04 '23 19:10 weaverryan

Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?

carsonbot avatar Apr 25 '24 12:04 carsonbot

Friendly ping? Should this still be open? I will close if I don't hear anything.

carsonbot avatar May 11 '24 07:05 carsonbot

Hey,

I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!

carsonbot avatar May 25 '24 07:05 carsonbot

Still not working (v2.19.3 ), the vale 'min_characters' => 3, is properly set.

paweelkopec avatar Sep 16 '24 17:09 paweelkopec

Could you create a reproducer for this bug ?

The idea is to get the smallest repository possible in which the bug can be observed... ... so we can install & test it easily and see what is not working as expected and why.

Documentation: https://symfony.com/doc/current/contributing/code/reproducer.html

Thank you!

smnandre avatar Sep 16 '24 20:09 smnandre

Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?

carsonbot avatar Mar 17 '25 12:03 carsonbot

Could I get an answer? If I do not hear anything I will assume this issue is resolved or abandoned. Please get back to me <3

carsonbot avatar Mar 31 '25 12:03 carsonbot

Hey,

I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!

carsonbot avatar Apr 14 '25 12:04 carsonbot

Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?

carsonbot avatar Oct 15 '25 12:10 carsonbot

Friendly ping? Should this still be open? I will close if I don't hear anything.

carsonbot avatar Oct 29 '25 12:10 carsonbot

Hey,

I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!

carsonbot avatar Nov 12 '25 12:11 carsonbot