Forráskód Böngészése

fix keyboard removal of choices. fixes #1839

Igor Vaynberg 11 éve
szülő
commit
cb7aefaeda
1 módosított fájl, 3 hozzáadás és 1 törlés
  1. 3 1
      select2.js

+ 3 - 1
select2.js

@@ -2443,6 +2443,7 @@ the specific language governing permissions and limitations under the Apache Lic
             return opts;
         },
 
+        // multi
         selectChoice: function (choice) {
 
             var selected = this.container.find(".select2-search-choice-focus");
@@ -2859,7 +2860,6 @@ the specific language governing permissions and limitations under the Apache Lic
             var val = this.getVal(),
                 data,
                 index;
-
             selected = selected.closest(".select2-search-choice");
 
             if (selected.length === 0) {
@@ -2889,6 +2889,8 @@ the specific language governing permissions and limitations under the Apache Lic
                 return;
             }
 
+            selected.remove();
+
             this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data });
             this.triggerChange({ removed: data });
         },