File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 176
176
}
177
177
} ;
178
178
179
- $ ( window ) . on ( 'resize' , that . fixPositionCapture ) ;
179
+ $ ( window ) . on ( 'resize.autocomplete ' , that . fixPositionCapture ) ;
180
180
181
181
that . el . on ( 'keydown.autocomplete' , function ( e ) { that . onKeyPress ( e ) ; } ) ;
182
182
that . el . on ( 'keyup.autocomplete' , function ( e ) { that . onKeyUp ( e ) ; } ) ;
242
242
243
243
fixPosition : function ( ) {
244
244
var that = this ,
245
- offset ;
245
+ offset ,
246
+ styles ;
246
247
247
248
// Don't adjsut position if custom container has been specified:
248
249
if ( that . options . appendTo !== 'body' ) {
251
252
252
253
offset = that . el . offset ( ) ;
253
254
254
- $ ( that . suggestionsContainer ) . css ( {
255
+ styles = {
255
256
top : ( offset . top + that . el . outerHeight ( ) ) + 'px' ,
256
257
left : offset . left + 'px'
257
- } ) ;
258
+ } ;
259
+
260
+ if ( that . options . width === 'auto' ) {
261
+ styles . width = ( that . el . outerWidth ( ) - 2 ) + 'px' ;
262
+ }
263
+
264
+ $ ( that . suggestionsContainer ) . css ( styles ) ;
258
265
} ,
259
266
260
267
enableKillerFn : function ( ) {
715
722
var that = this ;
716
723
that . el . off ( '.autocomplete' ) . removeData ( 'autocomplete' ) ;
717
724
that . disableKillerFn ( ) ;
718
- $ ( window ) . off ( 'resize' , that . fixPositionCapture ) ;
725
+ $ ( window ) . off ( 'resize.autocomplete ' , that . fixPositionCapture ) ;
719
726
$ ( that . suggestionsContainer ) . remove ( ) ;
720
727
}
721
728
} ;
You can’t perform that action at this time.
0 commit comments