From cd175c43eda04c2f0ade4201c9955731cfec2ae3 Mon Sep 17 00:00:00 2001 From: Henriette Darge Date: Tue, 10 Sep 2024 15:13:40 +0200 Subject: [PATCH] Do not overwrite custom data attributes but rather ammend to it --- .changeset/wicked-crews-provide.md | 5 +++++ app/components/primer/open_project/sub_header.rb | 16 ++++------------ 2 files changed, 9 insertions(+), 12 deletions(-) create mode 100644 .changeset/wicked-crews-provide.md diff --git a/.changeset/wicked-crews-provide.md b/.changeset/wicked-crews-provide.md new file mode 100644 index 0000000000..39100b58cd --- /dev/null +++ b/.changeset/wicked-crews-provide.md @@ -0,0 +1,5 @@ +--- +'@openproject/primer-view-components': patch +--- + +Do not overwrite custom data attributes diff --git a/app/components/primer/open_project/sub_header.rb b/app/components/primer/open_project/sub_header.rb index 4c982c67b0..301fec3121 100644 --- a/app/components/primer/open_project/sub_header.rb +++ b/app/components/primer/open_project/sub_header.rb @@ -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],