mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-10-05 01:44:18 +00:00
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.
This commit is contained in:
parent
63374dcb52
commit
81b2ef4a60
10
ui/jquery.ui.autocomplete.js
vendored
10
ui/jquery.ui.autocomplete.js
vendored
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user