Class: Formatic::Textarea

Inherits:
Base show all
Defined in:
app/components/formatic/textarea.rb

Overview

Text input for multi-line text.

Instance Method Summary collapse

Methods inherited from Base

#input_name, #param_key, #value, #wrapper

Methods inherited from ApplicationComponent

#initialize

Constructor Details

This class inherits a constructor from Formatic::ApplicationComponent

Instance Method Details

#css_classesObject



42
43
44
45
46
# File 'app/components/formatic/textarea.rb', line 42

def css_classes
  classes = %i[c-formatic-textarea__input js-formatic-textarea]
  classes.push(:'is-autosubmit') if async_submit
  classes
end

#input_optionsObject



29
30
31
32
33
34
35
36
37
38
39
40
# File 'app/components/formatic/textarea.rb', line 29

def input_options
  result = {
    placeholder: wrapper.placeholder,
    data: { '1p-ignore' => true },
    autofocus:,
    class: css_classes
  }

  (result[:value] = value) if value

  result
end