You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a select2 element that gets its data via ajax paged from the server. The select element shall allow multiple selections.
Selecting elements from page 1 works fine.
However, when selecting elements from page > 1 they appear briefly in the input box and then dissappear.
From scanning the source code I think whats happening is that a query request with search terms = "" is issued (without page field so my server returns page 1). Then the current viewValues are filtered by the result, so anything not on the first page gets ditched. This is the code block where that happens: https://github.com/rubenv/angular-select2/blob/master/src/select2.js#L199
Am I doing something wrong with my query function? Or is this a bug?
The text was updated successfully, but these errors were encountered:
I hacked together a workaround:
I store all retrieved items in an array (a set actually because I check for duplicates). Then essentially I do this in the query function:
I have a select2 element that gets its data via ajax paged from the server. The select element shall allow multiple selections.
Selecting elements from page 1 works fine.
However, when selecting elements from page > 1 they appear briefly in the input box and then dissappear.
From scanning the source code I think whats happening is that a query request with search terms = "" is issued (without page field so my server returns page 1). Then the current viewValues are filtered by the result, so anything not on the first page gets ditched. This is the code block where that happens: https://github.com/rubenv/angular-select2/blob/master/src/select2.js#L199
Am I doing something wrong with my query function? Or is this a bug?
The text was updated successfully, but these errors were encountered: