Skip to content
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] Autocomplete with specific controller - next_page entry isn't parsed after second load #2579

Open
arlin2050 opened this issue Feb 18, 2025 · 1 comment
Labels
Bug Bug Fix Status: Needs Review Needs to be reviewed

Comments

@arlin2050
Copy link

Hi,

First of all, thank you for this great project.
I'm facing a problem with ux autocomplete. I use autocomplete_url parameter to fetch results from a specific controller.
As I have many result, I use pagination.
First load and second load works great but after second load, next elements aren't loaded and I have 'No more results'.

Here are the results of my API from first load of url /api/professionnel?query=xxx :
{ "results": [ { "value": 2, "text": "XXX AAAAA" }, { "value": 5, "text": "XXX XXX" }, { "value": 7, "text": "XXX XXX" }, { "value": 8, "text": "XXX XXX" }, { "value": 11, "text": "XXX XXX" }, { "value": 14, "text": "XXX XXX" }, { "value": 18, "text": "XXX XXX" }, { "value": 19, "text": "XXX XXX" }, { "value": 20, "text": "XXX XXX" }, { "value": 26, "text": "XXX XXX" }, { "value": 30, "text": "XXX XXX" }, { "value": 31, "text": "XXX XXX" }, { "value": 37, "text": "XXX XXX" }, { "value": 41, "text": "XXX XXX" }, { "value": 43, "text": "XXX XXX" }, { "value": 44, "text": "XXX XXX" }, { "value": 45, "text": "XXX XXX" }, { "value": 46, "text": "XXX XXX" }, { "value": 50, "text": "XXX XXX" }, { "value": 56, "text": "XXX XXX" }, { "value": 57, "text": "XXX XXX" }, { "value": 58, "text": "XXX XXX" }, { "value": 61, "text": "XXX XXX" }, { "value": 63, "text": "XXX XXX" }, { "value": 74, "text": "XXX XXX" }, { "value": 75, "text": "XXX XXX" }, { "value": 80, "text": "XXX XXX" }, { "value": 87, "text": "XXX XXX" }, { "value": 95, "text": "XXX XXX" }, { "value": 96, "text": "XXX XXX" } ], "next_page": "/api/professionnel?query=xxx&page=2" }
and from second load :
{ "results": [ { "value": 98, "text": "XXX XXX" }, { "value": 100, "text": "XXX XXX" }, { "value": 101, "text": "XXX XXX" }, { "value": 102, "text": "XXX XXX" }, { "value": 104, "text": "XXX XXX" }, { "value": 105, "text": "XXX XXX" }, { "value": 107, "text": "XXX XXX" }, { "value": 108, "text": "XXX XXX" }, { "value": 109, "text": "XXX XXX" }, { "value": 111, "text": "XXX XXX" }, { "value": 116, "text": "XXX XXX" }, { "value": 117, "text": "XXX XXX" }, { "value": 121, "text": "XXX XXX" }, { "value": 132, "text": "XXX XXX" }, { "value": 133, "text": "XXX XXX" }, { "value": 134, "text": "XXX XXX" }, { "value": 139, "text": "XXX XXX" }, { "value": 144, "text": "XXX XXX" }, { "value": 147, "text": "XXX XXX" }, { "value": 148, "text": "XXX XXX" }, { "value": 150, "text": "XXX XXX" }, { "value": 155, "text": "XXX XXX" }, { "value": 156, "text": "XXX XXX" }, { "value": 157, "text": "XXX XXX" }, { "value": 158, "text": "XXX XXX" }, { "value": 165, "text": "XXX XXX" }, { "value": 166, "text": "XXX XXX" }, { "value": 172, "text": "XXX XXX" }, { "value": 173, "text": "XXX XXX" }, { "value": 178, "text": "XXX XXX" } ], "next_page": "/api/professionnel?query=xxx&page=3" }
After first load, 'next_page' entry is used to load more results but after second load I don't have any results.
I've been searching in controller.ts to find why 'next_page' entry isn't used after second load but I didn't find.

I'm not using anything special, no javascript, my field is just a ChoiceType with autocomplete and autocomplete_url options configured.
Can it be a bug or a problem in configuration ?

Thank you for your help

@arlin2050 arlin2050 added the Bug Bug Fix label Feb 18, 2025
@carsonbot carsonbot added the Status: Needs Review Needs to be reviewed label Feb 18, 2025
@arlin2050 arlin2050 changed the title Symfony UX Autocomplete with specific controller - next_page entry isn't parsed after second load [Autocomplete] Autocomplete with specific controller - next_page entry isn't parsed after second load Feb 18, 2025
@smnandre
Copy link
Member

Could you create a small reproducer to .. reproduce the bug and investigate ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug Fix Status: Needs Review Needs to be reviewed
Projects
None yet
Development

No branches or pull requests

3 participants