Skip to content

Commit 6065dab

Browse files
authored
Add textarea class to text field (#14)
[textarea Documentation](https://bulma.io/documentation/form/textarea/) Closes #13
1 parent 1e83518 commit 6065dab

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lib/generators/simple_form/theme/bulma/templates/config/initializers/simple_form_bulma.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,17 @@
108108
b.use :hint, wrap_with: { tag: 'small', class: 'help' }
109109
end
110110

111+
# bulma vertical textarea field
112+
config.wrappers :vertical_text_form, tag: 'div', class: 'field' do |b|
113+
b.use :html5
114+
b.use :placeholder
115+
b.optional :readonly
116+
b.use :label, class: 'label'
117+
b.use :input, class: 'textarea', wrap_with: { tag: 'div', class: 'control' }, error_class: 'is-danger', valid_class: 'is-success'
118+
b.use :full_error, wrap_with: { tag: 'div', class: 'help is-danger' }
119+
b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
120+
end
121+
111122
# The default wrapper to be used by the FormBuilder.
112123
config.default_wrapper = :vertical_form
113124

@@ -121,6 +132,7 @@
121132
file: :vertical_file,
122133
radio_buttons: :vertical_collection,
123134
range: :vertical_range,
124-
time: :vertical_multi_select
135+
time: :vertical_multi_select,
136+
text: :vertical_text_form
125137
}
126138
end

0 commit comments

Comments
 (0)