Permalink
Browse files

Checkboxradio: Do not update twice upon input vclick

(cherry picked from commit 805ff49)

Fixes gh-7378
1 parent 7342344 commit 180f8755bb1fe85c8c7a1a926fe792db45b03f29 @gabrielschulhof gabrielschulhof committed May 7, 2014
Showing with 3 additions and 3 deletions.
  1. +3 −3 js/widgets/forms/checkboxradio.js
@@ -135,7 +135,7 @@ $.widget( "mobile.checkboxradio", $.extend( {
// Adds checked attribute to checked input when keyboard is used
this.element.prop( "checked", this.element.is( ":checked" ) );
this._getInputSet().not( this.element ).prop( "checked", false );
- this._updateAll();
+ this._updateAll( true );
},
_handleLabelVMouseOver: function( event ) {
@@ -225,13 +225,13 @@ $.widget( "mobile.checkboxradio", $.extend( {
return radios;
},
- _updateAll: function() {
+ _updateAll: function( changeTriggered ) {
var self = this;
this._getInputSet().each( function() {
var $this = $( this );
- if ( this.checked || self.inputtype === "checkbox" ) {
+ if ( ( this.checked || self.inputtype === "checkbox" ) && !changeTriggered ) {
$this.trigger( "change" );
}
})

0 comments on commit 180f875

Please sign in to comment.