Преглед изворни кода

Firefox Tab and Enter keys issue.

When item is selected by enter, the list is reopened.
Also pressing tab on focused element with drop list cause immediate reopening with empty search result list.
MaxxSoftware пре 12 година
родитељ
комит
327e00b0ba
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      select2.js

+ 3 - 0
select2.js

@@ -1584,6 +1584,9 @@ the specific language governing permissions and limitations under the Apache Lic
                 }
             }));
             selection.bind("keypress", this.bind(function(e) {
+		if (e.which == KEY.DELETE || e.which == KEY.BACKSPACE || e.which == KEY.TAB || e.which == KEY.ENTER || e.which == 0) {
+			return
+		}
                 var key = String.fromCharCode(e.which);
                 this.search.val(key);
                 this.open();