Skip to content

Commit

Permalink
Event: Trigger checkbox and radio click events identically
Browse files Browse the repository at this point in the history
Fixes gh-3423
Closes gh-3494
  • Loading branch information
alexr101 authored and gibson042 committed Jan 19, 2017
1 parent 3c89329 commit b442aba
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions src/event.js
Expand Up @@ -3,12 +3,12 @@ define( [
"./var/document", "./var/document",
"./var/documentElement", "./var/documentElement",
"./var/rnothtmlwhite", "./var/rnothtmlwhite",
"./var/rcheckableType",
"./var/slice", "./var/slice",
"./data/var/dataPriv", "./data/var/dataPriv",

"./core/init", "./core/init",
"./selector" "./selector"
], function( jQuery, document, documentElement, rnothtmlwhite, slice, dataPriv ) { ], function( jQuery, document, documentElement, rnothtmlwhite, rcheckableType, slice, dataPriv ) {


"use strict"; "use strict";


Expand Down Expand Up @@ -474,9 +474,11 @@ jQuery.event = {
}, },
click: { 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() { 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(); this.click();
return false; return false;
} }
Expand Down
6 changes: 3 additions & 3 deletions src/manipulation.js
Expand Up @@ -2,8 +2,8 @@ define( [
"./core", "./core",
"./var/concat", "./var/concat",
"./var/push", "./var/push",
"./var/rcheckableType",
"./core/access", "./core/access",
"./manipulation/var/rcheckableType",
"./manipulation/var/rtagName", "./manipulation/var/rtagName",
"./manipulation/var/rscriptType", "./manipulation/var/rscriptType",
"./manipulation/wrapMap", "./manipulation/wrapMap",
Expand All @@ -21,8 +21,8 @@ define( [
"./traversing", "./traversing",
"./selector", "./selector",
"./event" "./event"
], function( jQuery, concat, push, access, ], function( jQuery, concat, push, rcheckableType,
rcheckableType, rtagName, rscriptType, access, rtagName, rscriptType,
wrapMap, getAll, setGlobalEval, buildFragment, support, wrapMap, getAll, setGlobalEval, buildFragment, support,
dataPriv, dataUser, acceptData, DOMEval ) { dataPriv, dataUser, acceptData, DOMEval ) {


Expand Down
2 changes: 1 addition & 1 deletion src/serialize.js
@@ -1,6 +1,6 @@
define( [ define( [
"./core", "./core",
"./manipulation/var/rcheckableType", "./var/rcheckableType",
"./core/init", "./core/init",
"./traversing", // filter "./traversing", // filter
"./attributes/prop" "./attributes/prop"
Expand Down
File renamed without changes.

0 comments on commit b442aba

Please sign in to comment.