Emagister / zend-form-decorators-bootstrap

Zend_Form decorators for Twitter's Bootstrap UI
http://emagister.github.com/zend-form-decorators-bootstrap
168 stars 79 forks source link

Space in markup causing gap between prepend value and text input #28

Closed oller closed 12 years ago

oller commented 12 years ago

With a prepended text input, there's a few pixel gap between the prefixed value and the text input itself.

I've diagnosed this as a markup issue, as there is a space/line break between those. Removing this fixes the gap.

Looks like the addon decorator needs tweaking to resolve this?

This only occurs with prepend, append is fine.

Am using bootstrap 2.0.4

willemo commented 12 years ago

I'm having the same issue. A dirty way to resolve this with jQuery is by using this code:

$('.input-prepend').each(function(){
    var input = $(this);
    var children = $(this).children();
    $(this).html('');
    $.each(children, function(i, child) {
        input.append(child);
    });
});

This removes all elements from the input-prepend div and re-appends them without the whitespace. It's a dirty fix, but it works for now.

lrobert commented 12 years ago

I've added a trim to the content when rendering the add-ons. Pull requested.