Skip to content

Commit cb7aefa

Browse files
committed
fix keyboard removal of choices. fixes select2#1839
1 parent 7fb1d01 commit cb7aefa

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

select2.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2443,6 +2443,7 @@ the specific language governing permissions and limitations under the Apache Lic
24432443
return opts;
24442444
},
24452445

2446+
// multi
24462447
selectChoice: function (choice) {
24472448

24482449
var selected = this.container.find(".select2-search-choice-focus");
@@ -2859,7 +2860,6 @@ the specific language governing permissions and limitations under the Apache Lic
28592860
var val = this.getVal(),
28602861
data,
28612862
index;
2862-
28632863
selected = selected.closest(".select2-search-choice");
28642864

28652865
if (selected.length === 0) {
@@ -2889,6 +2889,8 @@ the specific language governing permissions and limitations under the Apache Lic
28892889
return;
28902890
}
28912891

2892+
selected.remove();
2893+
28922894
this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data });
28932895
this.triggerChange({ removed: data });
28942896
},

0 commit comments

Comments
 (0)