Skip to content

Commit 051b9e0

Browse files
committed
Spinner: Use _getCreateOptions() for value.
1 parent 8799ba0 commit 051b9e0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/unit/spinner/spinner_defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ commonWidgetTests( "spinner", {
77
numberFormat: null,
88
page: 10,
99
step: 1,
10-
value: null,
10+
value: 0,
1111

1212
// callbacks
1313
change: null,

ui/jquery.ui.spinner.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $.widget( "ui.spinner", {
2424
numberFormat: null,
2525
page: 10,
2626
step: 1,
27-
value: null,
27+
value: 0,
2828

2929
change: null,
3030
spin: null,
@@ -33,7 +33,7 @@ $.widget( "ui.spinner", {
3333
},
3434

3535
_create: function() {
36-
this.value( this.options.value !== null ? this.options.value : this.element.val() || 0 );
36+
this.value( this.options.value );
3737
this._draw();
3838
this._mousewheel();
3939
this._aria();
@@ -43,9 +43,9 @@ $.widget( "ui.spinner", {
4343
var options = {},
4444
element = this.element;
4545

46-
$.each( [ "min", "max", "step" ], function( i, option ) {
46+
$.each( [ "min", "max", "step", "value" ], function( i, option ) {
4747
var value = element.attr( option );
48-
if ( value !== undefined ) {
48+
if ( value !== undefined && value.length ) {
4949
options[ option ] = value;
5050
}
5151
});

0 commit comments

Comments
 (0)