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

Properly loaded and ajax populated list: select a value at the press of a button #17251

Open
ItItaca opened this issue Aug 23, 2023 · 0 comments

Comments

@ItItaca
Copy link

ItItaca commented Aug 23, 2023

Hi all,
I'm successfully populating an awesomplete element using ajax with value - label objects.
Suggestions work as expected, and selection events trigger as planned. Using the selectcomplete event, the value is written in a hidden input, and the label is written in the dropdown input.
However I need to be able to -manually select- an item in the list, at the press of a button on the page, but this doesn't seem to work.
I can't understand if it's because of the value - label objects, or something else.

I've tried setting the .val() manually, by using the .select() but both methods simply don't select the value, despite not raising errors or warnings.
This happens both with and without .evaluate() after the data-load (the ._list property is properly filled).

Could it be that the combo needs to be .open() or something else, before .select() or .val() become viable? this doesn't seem to be easily tested since breakpoints in the code break the focus flow and the events, while using the inspector of the browsers.

Any suggestion welcome.

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant