From c82a6685bb964627e27008e298f93ea81218265b Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 27 Sep 2015 22:05:57 -0400 Subject: [PATCH] Event: Fix delegated radio events when arrow keys are used Fixes gh-2343, gh-2410 Close gh-2617 --- src/event.js | 7 +++-- test/integration/gh-2343-ie-radio-click.html | 33 ++++++++++++++++++++ 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 test/integration/gh-2343-ie-radio-click.html diff --git a/src/event.js b/src/event.js index 97dbf57b2..9d06781b7 100644 --- a/src/event.js +++ b/src/event.js @@ -488,9 +488,10 @@ jQuery.event = { // Find delegate handlers // Black-hole SVG instance trees (#13180) // - // Support: Firefox - // Avoid non-left-click bubbling in Firefox (#3861) - if ( delegateCount && cur.nodeType && ( !event.button || event.type !== "click" ) ) { + // Support: Firefox<=42+ + // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343) + if ( delegateCount && cur.nodeType && + ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) { for ( ; cur !== this; cur = cur.parentNode || this ) { diff --git a/test/integration/gh-2343-ie-radio-click.html b/test/integration/gh-2343-ie-radio-click.html new file mode 100644 index 000000000..4bc6956c3 --- /dev/null +++ b/test/integration/gh-2343-ie-radio-click.html @@ -0,0 +1,33 @@ + + + + + + Test for gh-2343 (IE11) + + + + + + +

Test for gh-2343 (IE11)

+

+Instructions: In IE11, click on or focus the first radio button. +Then use the left/right arrow keys to select the other radios. +You should see events logged in the results below. +

+
+ 0 + 1 + 2 +
+
+ + + -- 2.39.5