From 2c0344a520d477d2693d6bed222e4ee6a1da800d Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Tue, 10 Jul 2012 09:40:00 +0300 Subject: [PATCH] take the outerwidth of the element when sizing so we include padding and border. fixes #213 --- select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.js b/select2.js index b0aebd19..b86a3742 100755 --- a/select2.js +++ b/select2.js @@ -1070,7 +1070,7 @@ if (style.indexOf("%") > 0) return style; // finally, fallback on the calculated width of the element - return (this.opts.element.width() === 0 ? 'auto' : this.opts.element.width() + 'px'); + return (this.opts.element.width() === 0 ? 'auto' : this.opts.element.outerWidth() + 'px'); } });