File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 142142 container = $ ( that . suggestionsContainer ) ;
143143
144144 container . appendTo ( options . appendTo ) ;
145-
145+
146146 // Only set width if it was provided:
147147 if ( options . width !== 'auto' ) {
148148 container . width ( options . width ) ;
166166
167167 that . fixPosition ( ) ;
168168
169+ that . fixPositionCapture = function ( ) {
170+ that . fixPosition ( ) ;
171+ } ;
172+
173+ $ ( window ) . on ( 'resize' , that . fixPositionCapture ) ;
174+
169175 that . el . on ( 'keydown.autocomplete' , function ( e ) { that . onKeyPress ( e ) ; } ) ;
170176 that . el . on ( 'keyup.autocomplete' , function ( e ) { that . onKeyUp ( e ) ; } ) ;
171177 that . el . on ( 'blur.autocomplete' , function ( ) { that . onBlur ( ) ; } ) ;
219225 var that = this ,
220226 offset ;
221227
222- // Don't adjsut position if custom container has been specified:
223- if ( that . options . appendTo !== 'body' ) {
228+ // Don't adjsut position if not visible or custom container has been specified:
229+ if ( ! that . visible || that . options . appendTo !== 'body' ) {
224230 return ;
225231 }
226232
605611 var that = this ;
606612 that . el . off ( '.autocomplete' ) . removeData ( 'autocomplete' ) ;
607613 that . disableKillerFn ( ) ;
614+ $ ( window ) . off ( 'resize' , that . fixPositionCapture ) ;
608615 $ ( that . suggestionsContainer ) . remove ( ) ;
609616 }
610617 } ;
You can’t perform that action at this time.
0 commit comments