From: Heinrich Fenkart Date: Wed, 12 Nov 2014 00:18:06 +0000 (+0100) Subject: Dropdown: ignore keydown events coming from `input`s and `textarea`s X-Git-Tag: v3.3.1~12^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d55ada581e2e669cc7c163dc469b9184bbd8f7d;p=thirdparty%2Fbootstrap.git Dropdown: ignore keydown events coming from `input`s and `textarea`s Fixes #15084. --- diff --git a/js/dropdown.js b/js/dropdown.js index ae192e570d..64ec34d5d8 100644 --- a/js/dropdown.js +++ b/js/dropdown.js @@ -55,7 +55,7 @@ } Dropdown.prototype.keydown = function (e) { - if (!/(38|40|27|32)/.test(e.which)) return + if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return var $this = $(this) diff --git a/js/tests/unit/dropdown.js b/js/tests/unit/dropdown.js index 335795fde8..3cdf637ee0 100644 --- a/js/tests/unit/dropdown.js +++ b/js/tests/unit/dropdown.js @@ -224,4 +224,45 @@ $(function () { $(document.body).click() }) + test('should ignore keyboard events within s and