Skip to content

Commit

Permalink
feature: override auto-generated data attributes (#2501)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob authored Feb 21, 2024
1 parent fee2f4d commit a27aebd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/components/avo/field_wrapper_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ def data
**@data
}

# Fetch the data attributes off the html option
wrapper_data_attributes = @field.get_html :data, view: view, element: :wrapper
if wrapper_data_attributes.present?
attributes.merge! wrapper_data_attributes
end

# Add the built-in stimulus integration data tags.
if @resource.present?
add_stimulus_attributes_for(@resource, attributes)
Expand All @@ -91,12 +97,6 @@ def data
add_stimulus_attributes_for(@action, attributes)
end

# Fetch the data attributes off the html option
wrapper_data_attributes = @field.get_html :data, view: view, element: :wrapper
if wrapper_data_attributes.present?
attributes.merge! wrapper_data_attributes
end

attributes
end

Expand Down

0 comments on commit a27aebd

Please sign in to comment.