Skip to content

Commit bdd602e

Browse files
committed
Spinner: Re-enable autocomplete if the page is unloaded so the browser will remember the current value when navigating through history.
1 parent 81b2ef4 commit bdd602e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ui/jquery.ui.spinner.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ $.widget( "ui.spinner", {
4949
this._draw();
5050
this._bind( this._events );
5151
this._refresh();
52+
53+
// turning off autocomplete prevents the browser from remembering the
54+
// value when navigating through history, so we re-enable autocomplete
55+
// if the page is unloaded before the widget is destroyed. #7790
56+
this._bind( this.element[0].ownerDocument.defaultView, {
57+
beforeunload: function() {
58+
this.element.removeAttr( "autocomplete" );
59+
}
60+
});
5261
},
5362

5463
_getCreateOptions: function() {

0 commit comments

Comments
 (0)