diff options
author | Alex Padilla <alexonezero@outlook.com> | 2017-01-11 15:19:30 -0700 |
---|---|---|
committer | Richard Gibson <richard.gibson@gmail.com> | 2017-01-19 16:51:49 -0500 |
commit | b442abacbb8464f0165059e8da734e3143d0721f (patch) | |
tree | 3792b81cb338b317c83c4f14c23d0a7d1ddee1bd /src/event.js | |
parent | 3c89329cb24cb144c3296cf0589bce9ca59d63a3 (diff) | |
download | jquery-b442abacbb8464f0165059e8da734e3143d0721f.tar.gz jquery-b442abacbb8464f0165059e8da734e3143d0721f.zip |
Event: Trigger checkbox and radio click events identically
Fixes gh-3423
Closes gh-3494
Diffstat (limited to 'src/event.js')
-rw-r--r-- | src/event.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/event.js b/src/event.js index ab2c63cd1..97431773c 100644 --- a/src/event.js +++ b/src/event.js @@ -3,12 +3,12 @@ define( [ "./var/document", "./var/documentElement", "./var/rnothtmlwhite", + "./var/rcheckableType", "./var/slice", "./data/var/dataPriv", - "./core/init", "./selector" -], function( jQuery, document, documentElement, rnothtmlwhite, slice, dataPriv ) { +], function( jQuery, document, documentElement, rnothtmlwhite, rcheckableType, slice, dataPriv ) { "use strict"; @@ -474,9 +474,11 @@ jQuery.event = { }, click: { - // For checkbox, fire native event so checked state will be right + // For checkable types, fire native event so checked state will be right trigger: function() { - if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) { + if ( rcheckableType.test( this.type ) && + this.click && jQuery.nodeName( this, "input" ) ) { + this.click(); return false; } |