Skip to content

Commit 08a7a11

Browse files
committed
Spinner: Don't set focus on stop, focus should already be correct. Always remove ui-state-active on blur, since we no longer blur when interacting with buttons.
1 parent 64cdaa8 commit 08a7a11

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

ui/jquery.ui.spinner.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,7 @@ $.widget( "ui.spinner", {
8989
if ( parsed === null ) {
9090
this.element.val( value );
9191
}
92-
// TODO: is this really correct or just the simplest
93-
// way to keep the active class when pressing the buttons?
94-
// if the mosue is over the text field and the user tabs out
95-
// shouldn't the active class get removed?
96-
if ( !uiSpinner.hasClass( "ui-state-hover" ) ) {
97-
uiSpinner.removeClass( "ui-state-active" );
98-
}
92+
uiSpinner.removeClass( "ui-state-active" );
9993
}
10094
});
10195

@@ -139,7 +133,7 @@ $.widget( "ui.spinner", {
139133
// TODO: do we really want to consider this a stop?
140134
// shouldn't we just stop the repeater and wait until mouseup before
141135
// we trigger the stop event?
142-
mouseleave: function() {
136+
mouseleave: function( event ) {
143137
if ( this.spinning ) {
144138
this._stop( event );
145139
this._change( event );
@@ -284,7 +278,6 @@ $.widget( "ui.spinner", {
284278
_stop: function( event ) {
285279
clearTimeout( this.timer );
286280
this.counter = 0;
287-
this.element.focus();
288281
this.spinning = false;
289282
this._trigger( "stop", event );
290283
},

0 commit comments

Comments
 (0)