From 578f796d3edf90db5b8f7c3d7c6c93f97a91b84b Mon Sep 17 00:00:00 2001 From: Juan Vasquez Date: Wed, 11 Sep 2024 22:29:21 -0600 Subject: [PATCH] Add textarea class to text field [textarea Documentation](https://bulma.io/documentation/form/textarea/) Closes #13 --- .../config/initializers/simple_form_bulma.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/generators/simple_form/theme/bulma/templates/config/initializers/simple_form_bulma.rb b/lib/generators/simple_form/theme/bulma/templates/config/initializers/simple_form_bulma.rb index 4f9eda9..d7684c3 100644 --- a/lib/generators/simple_form/theme/bulma/templates/config/initializers/simple_form_bulma.rb +++ b/lib/generators/simple_form/theme/bulma/templates/config/initializers/simple_form_bulma.rb @@ -108,6 +108,17 @@ b.use :hint, wrap_with: { tag: 'small', class: 'help' } end + # bulma vertical textarea field + config.wrappers :vertical_text_form, tag: 'div', class: 'field' do |b| + b.use :html5 + b.use :placeholder + b.optional :readonly + b.use :label, class: 'label' + b.use :input, class: 'textarea', wrap_with: { tag: 'div', class: 'control' }, error_class: 'is-danger', valid_class: 'is-success' + b.use :full_error, wrap_with: { tag: 'div', class: 'help is-danger' } + b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' } + end + # The default wrapper to be used by the FormBuilder. config.default_wrapper = :vertical_form @@ -121,6 +132,7 @@ file: :vertical_file, radio_buttons: :vertical_collection, range: :vertical_range, - time: :vertical_multi_select + time: :vertical_multi_select, + text: :vertical_text_form } end