use merged newData in case where an option already exists when using ArrayAdapter
This commit is contained in:
parent
3422460488
commit
f5593e12e4
2
src/js/select2/data/array.js
vendored
2
src/js/select2/data/array.js
vendored
@ -54,7 +54,7 @@ define([
|
|||||||
var existingData = this.item($existingOption);
|
var existingData = this.item($existingOption);
|
||||||
var newData = $.extend(true, {}, existingData, item);
|
var newData = $.extend(true, {}, existingData, item);
|
||||||
|
|
||||||
var $newOption = this.option(existingData);
|
var $newOption = this.option(newData);
|
||||||
|
|
||||||
$existingOption.replaceWith($newOption);
|
$existingOption.replaceWith($newOption);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user