jquery.chosen: set default text width to auto
authorRyan Lane <rlane@wikimedia.org>
Thu, 22 Aug 2013 23:38:34 +0000 (16:38 -0700)
committerRyan Lane <rlane@wikimedia.org>
Thu, 22 Aug 2013 23:38:34 +0000 (16:38 -0700)
Rather than hardcoding the default text width to 25px, set the
default to auto, so that when using width: auto for the chosen
container an empty input won't be 25px.

Change-Id: I694daa263f921c9e5a0490519af352d173fb4c9d

resources/jquery.chosen/chosen.jquery.js

index a240ebd..745174f 100644 (file)
@@ -391,7 +391,7 @@ Copyright (c) 2011 by Harvest
       };
       this.container = $("<div />", container_props);
       if (this.is_multiple) {
-        this.container.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop"><ul class="chzn-results"></ul></div>');
+        this.container.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:auto;" /></li></ul><div class="chzn-drop"><ul class="chzn-results"></ul></div>');
       } else {
         this.container.html('<a href="javascript:void(0)" class="chzn-single chzn-default" tabindex="-1"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chzn-drop"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>');
       }