Skip to content

Commit

Permalink
only send content to tags that support it
Browse files Browse the repository at this point in the history
  • Loading branch information
rjacoby committed Jan 28, 2025
1 parent 07ccca9 commit 97502f1
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions admin/app/components/solidus_admin/ui/forms/input/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,22 @@ def call
with_content options_for_select(@attributes.delete(:choices), @attributes.delete(:value))
end

tag.public_send(
@tag,
content,
options = {
"data-controller": stimulus_id,
"data-#{stimulus_id}-custom-validity-value": @error.presence,
"data-action": "#{stimulus_id}#clearCustomValidity",
**@attributes
)
}

if @tag == :input
tag.public_send(
@tag,
**options)
else
tag.public_send(
@tag,
content,
**options)
end
end
end

0 comments on commit 97502f1

Please sign in to comment.