documentcloud/visualsearch — Issue #40: search_facet_input width not wide enough
Author: littlebee
Created: 2012-01-23 21:57:29+00:00
State: open

Hi,

I'm having a problem that I couldn't resolve through css. The width of search_facet_input, computed by autoGrowInput(), is just a little too little. See https://skitch.com/lilbee/g5fua/greencon-2011-attendees

The only solution I've come up with is a hack on hack:

Index: public/javascripts/vendor/visualsearch.js
===================================================================
--- public/javascripts/vendor/visualsearch.js	(revision d5bab795c8d3e2a047896f403fe9cab4fe226b7d)
+++ public/javascripts/vendor/visualsearch.js	(revision cfcbe179e877eada55916cbf390df051badec9e2)
@@ -1458,7 +1458,7 @@
.replace(/>/g, '>');

$tester.html(value);
- $input.width($tester.width() + 3);
+ $input.width($tester.width() + 6);
$input.trigger('updated.autogrow');
});

Is there a way to do this via css?

I doubt you would want to pull the change above as clearly this problem is instigated by something in our css, combined with the visualsearch css. I can try to add an option to specify what the padding is and submit that in a pull request if unable to do via css.

Thanks for yet another super awesome component!

~b