Skip to content
Permalink
Browse files

Autocomplete: Re-enable native autocomplete whent he page is unloaded…

…. Fixes #7790 - Autocomplete-enabled text input does not keep value when using back button in browser.
  • Loading branch information...
scottgonzalez committed Oct 17, 2011
1 parent 63374dc commit 81b2ef4a6088cb99863c2d318947355a58019362
Showing with 10 additions and 0 deletions.
  1. +10 −0 ui/jquery.ui.autocomplete.js
@@ -265,9 +265,19 @@ $.widget( "ui.autocomplete", {
.zIndex( this.element.zIndex() + 1 )
.hide()
.data( "menu" );

if ( $.fn.bgiframe ) {
this.menu.element.bgiframe();
}

// 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( doc.defaultView, {
beforeunload: function() {
this.element.removeAttr( "autocomplete" );
}
});
},

_destroy: function() {

0 comments on commit 81b2ef4

Please sign in to comment.
You can’t perform that action at this time.