Skip to content

Commit 835a039

Browse files
author
Tomas Kirda
committed
Don't adjust position on resize if suggestions not visible.
1 parent cc0e124 commit 835a039

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/jquery.autocomplete.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@
167167
that.fixPosition();
168168

169169
that.fixPositionCapture = function () {
170-
that.fixPosition();
170+
if (that.visible) {
171+
that.fixPosition();
172+
}
171173
};
172174

173175
$(window).on('resize', that.fixPositionCapture);
@@ -225,8 +227,8 @@
225227
var that = this,
226228
offset;
227229

228-
// Don't adjsut position if not visible or custom container has been specified:
229-
if (!that.visible || that.options.appendTo !== 'body') {
230+
// Don't adjsut position if custom container has been specified:
231+
if (that.options.appendTo !== 'body') {
230232
return;
231233
}
232234

0 commit comments

Comments
 (0)