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
+ self.beforeunloadHandler = function() {
+ self.element.removeAttr( "autocomplete" );
+ };
+ $( window ).bind( "beforeunload", self.beforeunloadHandler );
},
destroy: function() {
.removeAttr( "aria-autocomplete" )
.removeAttr( "aria-haspopup" );
this.menu.element.remove();
+ $( window ).unbind( "beforeunload", this.beforeunloadHandler );
$.Widget.prototype.destroy.call( this );
},