Skip to content

Commit d487fc5

Browse files
committed
Merge pull request select2#2360 from ycdtosa/master
changes on updateResults, populate by @cervengoc on select2#781
2 parents f544f9d + 0f8a85b commit d487fc5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

select2.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,8 @@ the specific language governing permissions and limitations under the Apache Lic
920920

921921
results = opts.sortResults(results, container, query);
922922

923+
// collect the created nodes for bulk append
924+
var nodes = [];
923925
for (i = 0, l = results.length; i < l; i = i + 1) {
924926

925927
result=results[i];
@@ -959,9 +961,11 @@ the specific language governing permissions and limitations under the Apache Lic
959961
}
960962

961963
node.data("select2-data", result);
962-
container.append(node);
964+
nodes.push(node[0]);
963965
}
964966

967+
// bulk append the created nodes
968+
container.append(nodes);
965969
liveRegion.text(opts.formatMatches(results.length));
966970
};
967971

0 commit comments

Comments
 (0)