Simple_form: textarea is filled with mysterious white spaces

Created on 18 Jun 2015  路  5Comments  路  Source: heartcombo/simple_form

I use textarea for nested field.
I don't know why textarea is filled with mysterious white spaces.

my code

= f.simple_fields_for :steps do |step_form|
        = step_form.input :description, as: :text, label: false, input_html: { class: 'nested_field' }

result

<textarea class="text optional nested_field" placeholder="how to ..." name="recipe[steps_attributes][1434631626139][description]" id="recipe_steps_attributes_1434631626139_description">        </textarea>

Help me, please....

Most helpful comment

It's not a simple_form bug. It's happening to me as I use cocoon gem to include nested models in my form. It's (I think) because cocoon grabs HTML code from a data attribute and there are white spaces in it. You can fix this by using an ugly output for your slim, haml, or whatever preprocessor. Anyway, it's happening to me just in development environment, it still works nice in production as there's always the ugly mode on.

All 5 comments

Please use the mailing list or stack overflow for questions, we reserve the issues tracker for issues. Thanks!

This is a bug. I'm experiencing the same thing. I have a placeholder value set and it doesn't show because there are spaces being inserted. Rather than simple_form generating it's generating . When I then click in the field, the cursor is at the end of these spaces so the user has to first delete them, and then can type. I tried setting a default value to an empty string but that didn't solve it.

It's not a simple_form bug. It's happening to me as I use cocoon gem to include nested models in my form. It's (I think) because cocoon grabs HTML code from a data attribute and there are white spaces in it. You can fix this by using an ugly output for your slim, haml, or whatever preprocessor. Anyway, it's happening to me just in development environment, it still works nice in production as there's always the ugly mode on.

user google.translate
provavelmente voc锚 esta usando assim:
...

o correto seria usar tudo em uma linha s贸, assim:

at茅 mais. bye

Define your