Add support for placeholder attribute to component
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-06-20 13:54:59 +02:00
parent 40b34d0935
commit fff6dea100
2 changed files with 3 additions and 1 deletions
@@ -2,7 +2,7 @@
module FormElements
class FieldsetResettableSettingComponent < ViewComponent::Base
def initialize(tag: "li", key:, type: :text, title:, description: nil)
def initialize(tag: "li", key:, type: :text, title:, description: nil, placeholder: nil)
@tag = tag
@positioning = :vertical
@title = title
@@ -10,6 +10,7 @@ module FormElements
@key = key.to_sym
@type = type
@resettable = is_resettable?(@key)
@placeholder = placeholder
end
def is_resettable?(key)