From ec01932c4dcb3c655ed6596545a043b5b474f698 Mon Sep 17 00:00:00 2001 From: ashrayjain Date: Sun, 21 Jul 2013 23:11:59 +0530 Subject: [PATCH] Added width updation on resize The width of the autocomplete suggestions box now updates on resize to match the parent width, in addition to the position. --- src/jquery.autocomplete.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/jquery.autocomplete.js b/src/jquery.autocomplete.js index 2399079..517bbcc 100644 --- a/src/jquery.autocomplete.js +++ b/src/jquery.autocomplete.js @@ -228,7 +228,8 @@ fixPosition: function () { var that = this, - offset; + offset, + width; // Don't adjsut position if custom container has been specified: if (that.options.appendTo !== 'body') { @@ -236,10 +237,12 @@ } offset = that.el.offset(); + width = that.el.outerWidth() - 2; $(that.suggestionsContainer).css({ top: (offset.top + that.el.outerHeight()) + 'px', - left: offset.left + 'px' + left: offset.left + 'px', + width: width + 'px' }); },