From 9baada2a5c5c7856f031a2f0df8fd3c5bf3c65b0 Mon Sep 17 00:00:00 2001 From: Royce Feng Date: Tue, 3 Jul 2012 10:03:21 -0400 Subject: [PATCH] Default to auto width if container has 0 width (hidden) --- select2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2.js b/select2.js index d4960a53..4884a0fb 100755 --- a/select2.js +++ b/select2.js @@ -1033,7 +1033,7 @@ return matches[1]; } } - return this.opts.element.width() + 'px'; + return (this.opts.element.width() === 0 ? 'auto' : this.opts.element.width() + 'px'); } });