Merge pull request #26849 from woocommerce/fix/26845
Put back the remove element for multiselects on selectWoo
This commit is contained in:
commit
a442f183ad
|
@ -1748,12 +1748,14 @@ S2.define('select2/selection/multiple',[
|
||||||
var selection = data[d];
|
var selection = data[d];
|
||||||
|
|
||||||
var $selection = this.selectionContainer();
|
var $selection = this.selectionContainer();
|
||||||
|
var removeItemTag = $selection.html();
|
||||||
var formatted = this.display(selection, $selection);
|
var formatted = this.display(selection, $selection);
|
||||||
if ('string' === typeof formatted) {
|
if ('string' === typeof formatted) {
|
||||||
formatted = Utils.entityDecode(formatted.trim());
|
formatted = Utils.entityDecode(formatted.trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
$selection.text(formatted);
|
$selection.text(formatted);
|
||||||
|
$selection.prepend(removeItemTag);
|
||||||
$selection.prop('title', selection.title || selection.text);
|
$selection.prop('title', selection.title || selection.text);
|
||||||
|
|
||||||
$selection.data('data', selection);
|
$selection.data('data', selection);
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1748,12 +1748,14 @@ S2.define('select2/selection/multiple',[
|
||||||
var selection = data[d];
|
var selection = data[d];
|
||||||
|
|
||||||
var $selection = this.selectionContainer();
|
var $selection = this.selectionContainer();
|
||||||
|
var removeItemTag = $selection.html();
|
||||||
var formatted = this.display(selection, $selection);
|
var formatted = this.display(selection, $selection);
|
||||||
if ('string' === typeof formatted) {
|
if ('string' === typeof formatted) {
|
||||||
formatted = Utils.entityDecode(formatted.trim());
|
formatted = Utils.entityDecode(formatted.trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
$selection.text(formatted);
|
$selection.text(formatted);
|
||||||
|
$selection.prepend(removeItemTag);
|
||||||
$selection.prop('title', selection.title || selection.text);
|
$selection.prop('title', selection.title || selection.text);
|
||||||
|
|
||||||
$selection.data('data', selection);
|
$selection.data('data', selection);
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue