]> source.dussan.org Git - jquery-ui.git/commitdiff
Spinner: Re-enable autocomplete if the page is unloaded so the browser will remember...
authorScott González <scott.gonzalez@gmail.com>
Mon, 17 Oct 2011 14:12:35 +0000 (10:12 -0400)
committerScott González <scott.gonzalez@gmail.com>
Mon, 17 Oct 2011 14:12:35 +0000 (10:12 -0400)
ui/jquery.ui.spinner.js

index be2aaa24620eda9c02dc480d41c9e65b18b28a58..7fc291c00e34977be45af4c61958a9b7122b70eb 100644 (file)
@@ -49,6 +49,15 @@ $.widget( "ui.spinner", {
                this._draw();
                this._bind( this._events );
                this._refresh();
+
+               // turning off autocomplete prevents the browser from remembering the
+               // value when navigating through history, so we re-enable autocomplete
+               // if the page is unloaded before the widget is destroyed. #7790
+               this._bind( this.element[0].ownerDocument.defaultView, {
+                       beforeunload: function() {
+                               this.element.removeAttr( "autocomplete" );
+                       }
+               });
        },
 
        _getCreateOptions: function() {