Skip to content

Commit cfd1a86

Browse files
committed
Progressbar: Prevent firing change event on create for both determinate and indeterminate
1 parent 0de9a18 commit cfd1a86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ui/jquery.ui.progressbar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ $.widget( "ui.progressbar", {
3636
this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" )
3737
.appendTo( this.element );
3838

39+
this.oldValue = this._value();
3940
this._refreshValue();
4041
},
4142

@@ -62,7 +63,6 @@ $.widget( "ui.progressbar", {
6263
_setOption: function( key, value ) {
6364
if ( key === "value" ) {
6465
this.options.value = value;
65-
6666
this._refreshValue();
6767
if ( this._value() === this.options.max ) {
6868
this._trigger( "complete" );
@@ -94,7 +94,7 @@ $.widget( "ui.progressbar", {
9494

9595
this.valueDiv.toggleClass( "ui-progressbar-indeterminate", isNaN( value ) );
9696

97-
if ( this.oldValue !== value ) {
97+
if ( this.oldValue !== value && ( !isNaN( this.oldValue ) || !isNaN( value ) ) ) {
9898
this.oldValue = value;
9999
this._trigger( "change" );
100100
}

0 commit comments

Comments
 (0)