Skip to content

Commit

Permalink
Do not overwrite custom data attributes but rather ammend to it
Browse files Browse the repository at this point in the history
  • Loading branch information
HDinger committed Sep 10, 2024
1 parent f6b37f6 commit cd175c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-crews-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@openproject/primer-view-components': patch
---

Do not overwrite custom data attributes
16 changes: 4 additions & 12 deletions app/components/primer/open_project/sub_header.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,14 @@ class SubHeader < Primer::Component
system_arguments[:input_width] ||= :medium

system_arguments[:data] ||= {}
system_arguments[:data][:target]= "sub-header.filterInput"
system_arguments[:data][:target] ||= ""
system_arguments[:data][:target] += " sub-header.filterInput"

system_arguments[:show_clear_button] = true if system_arguments[:show_clear_button].nil?

if system_arguments[:show_clear_button]
system_arguments[:data] = merge_data(
system_arguments,
{
data: {
action: <<~JS
input:sub-header#toggleFilterInputClearButton
focus:sub-header#toggleFilterInputClearButton
JS
}
}
)
system_arguments[:data][:action] ||= ""
system_arguments[:data][:action] += " input:sub-header#toggleFilterInputClearButton focus:sub-header#toggleFilterInputClearButton"
end

@mobile_filter_trigger = Primer::Beta::IconButton.new(icon: system_arguments[:leading_visual][:icon],
Expand Down

0 comments on commit cd175c4

Please sign in to comment.