From 7ab95da446889e58bb72fe532fcd12779c4093bb Mon Sep 17 00:00:00 2001 From: Nida Ghuman Date: Mon, 6 May 2024 10:55:15 -0400 Subject: [PATCH] Dropdown to Use Content Tag instead of pb_content_tag (#3392) Since we are reverting the PR that created the pb_content_tag [here](https://github.com/powerhome/playbook/pull/3391), we are reverting the dropdown kit to NOT use that pb_content_tag --- .../app/pb_kits/playbook/pb_dropdown/dropdown.html.erb | 7 ++++++- .../playbook/pb_dropdown/dropdown_container.html.erb | 8 +++++++- .../pb_kits/playbook/pb_dropdown/dropdown_option.html.erb | 7 ++++++- .../playbook/pb_dropdown/dropdown_trigger.html.erb | 7 ++++++- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/playbook/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb b/playbook/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb index 19a3bd2181..c990bb0f49 100644 --- a/playbook/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +++ b/playbook/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb @@ -1,4 +1,9 @@ -<%= pb_content_tag do %> +<%= content_tag(:div, + aria: object.aria, + class: object.classname, + data: object.data, + id: object.id, + **combined_html_options) do %> <% if object.label.present? %> <%= pb_rails("caption", props: {text: object.label, margin_bottom:"xs"}) %> <% end %> diff --git a/playbook/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb b/playbook/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb index 586533b024..b139446f3a 100644 --- a/playbook/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +++ b/playbook/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb @@ -1,4 +1,10 @@ -<%= pb_content_tag(:div, style: object.container_style) do %> +<%= content_tag(:div, + aria: object.aria, + class: object.classname, + data: object.data, + id: object.id, + style: object.container_style, + **combined_html_options) do %> <%= pb_rails("list", props: {ordered: false, borderless: false}) do %> <% if content.present? %> <%= content.presence %> diff --git a/playbook/app/pb_kits/playbook/pb_dropdown/dropdown_option.html.erb b/playbook/app/pb_kits/playbook/pb_dropdown/dropdown_option.html.erb index 9cf25b18df..51b68ed9d3 100644 --- a/playbook/app/pb_kits/playbook/pb_dropdown/dropdown_option.html.erb +++ b/playbook/app/pb_kits/playbook/pb_dropdown/dropdown_option.html.erb @@ -1,4 +1,9 @@ -<%= pb_content_tag do %> +<%= content_tag(:div, + aria: object.aria, + class: object.classname, + data: object.data, + id: object.id, + **combined_html_options) do %> <%= pb_rails("list/item", props: { display: "flex", justify_content: "center", diff --git a/playbook/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb b/playbook/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb index dd4478bb4b..85df55c4ec 100644 --- a/playbook/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb +++ b/playbook/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb @@ -1,4 +1,9 @@ -<%= pb_content_tag do %> +<%= content_tag(:div, + aria: object.aria, + class: object.classname, + data: object.data, + id: object.id, + **combined_html_options) do %> <% if content.present? %>
<%= content.presence %>