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

Dropdown getting closed once we have dynamic data returned from API ( multi select select2 use case ) #143

Open
chetanmenge opened this issue Apr 1, 2019 · 0 comments

Comments

@chetanmenge
Copy link

Scenario:
I'm using ng2-select2 with multiple option set as True.
Based on the entered data in search box, we are making backend call ( async ) to retrieve the result. And once we have result we are assigning back to select2 data. So it's kind of dynamic data. ( Data will be populated based on input search and it will keep on changing )

Issue which we are facing is - Once results comes back from API drop down is getting closed. So user will have to click/focus in the select2 search field to see updated data.

Question : Is there any way to show/open drop down after changing options dynamically ?

FYI,
I could see select2 has open method (https://select2.org/programmatic-control/methods)
$('#mySelect2').select2('data');

But anyway this can be called in the angular wrapper which we are using ( ng2-select2 )

Thanks,
Chetan

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