Class: SimpleForm::Tailwind::Inputs::PasswordInput

Inherits:
Inputs::PasswordInput
  • Object
show all
Includes:
OverwriteClassWithErrorOrValidClass
Defined in:
lib/simple_form/tailwind/inputs/password_input.rb

Instance Method Summary collapse

Methods included from OverwriteClassWithErrorOrValidClass

#set_input_classes

Instance Method Details

#input(*args, &blk) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/simple_form/tailwind/inputs/password_input.rb', line 8

def input(*args, &blk)
  if has_errors?
    template.(:div, (
      super + (
        template.(
          :div,
          template.heroicon("exclamation-circle", options: { class: "h-5 w-5 text-red-500" }),
          class: "absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none"
        )
      )
    ), class: "mt-1 relative rounded-md shadow-sm")
  else
    template.(:div, super, class: "mt-1")
  end
end