From 62a5255e024d9ff268438cb76098d43c2a4f411d Mon Sep 17 00:00:00 2001 From: Yacine Kanzari <1786317+yxuko@users.noreply.github.com> Date: Sat, 21 Mar 2026 15:14:11 +0100 Subject: [PATCH] Fix select is hidden inside dialog (#1196) * Fix Select hidden inside Dialog * Fix regression in Drawer --- app/components/DS/dialog.html.erb | 2 +- app/components/DS/dialog.rb | 7 ++++--- app/views/transactions/new.html.erb | 2 +- app/views/transfers/new.html.erb | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/components/DS/dialog.html.erb b/app/components/DS/dialog.html.erb index a26b0ae7c..3487ed89e 100644 --- a/app/components/DS/dialog.html.erb +++ b/app/components/DS/dialog.html.erb @@ -2,7 +2,7 @@ <%= tag.dialog class: "w-full h-full bg-transparent theme-dark:backdrop:bg-alpha-black-900 backdrop:bg-overlay pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)] #{(drawer? || responsive?) ? "lg:p-3" : "lg:p-1"}", **merged_opts do %> <%= tag.div class: dialog_outer_classes do %> <%= tag.div class: dialog_inner_classes, data: { DS__dialog_target: "content" } do %> -
+
<% if header? %> <%= header %> <% end %> diff --git a/app/components/DS/dialog.rb b/app/components/DS/dialog.rb index 536febf6c..e9c4eb3ae 100644 --- a/app/components/DS/dialog.rb +++ b/app/components/DS/dialog.rb @@ -33,7 +33,7 @@ class DS::Dialog < DesignSystemComponent end end - attr_reader :variant, :auto_open, :reload_on_close, :width, :disable_frame, :content_class, :disable_click_outside, :opts, :responsive + attr_reader :variant, :auto_open, :reload_on_close, :width, :disable_frame, :content_class, :disable_click_outside, :opts, :responsive, :scrollable VARIANTS = %w[modal drawer].freeze WIDTHS = { @@ -43,7 +43,7 @@ class DS::Dialog < DesignSystemComponent full: "lg:max-w-full" }.freeze - def initialize(variant: "modal", auto_open: true, reload_on_close: false, width: "md", frame: nil, disable_frame: false, content_class: nil, disable_click_outside: false, responsive: false, **opts) + def initialize(variant: "modal", auto_open: true, reload_on_close: false, width: "md", frame: nil, disable_frame: false, content_class: nil, disable_click_outside: false, responsive: false, scrollable: true, **opts) @variant = variant.to_sym @auto_open = auto_open @reload_on_close = reload_on_close @@ -53,6 +53,7 @@ class DS::Dialog < DesignSystemComponent @content_class = content_class @disable_click_outside = disable_click_outside @responsive = responsive + @scrollable = scrollable @opts = opts end @@ -97,7 +98,7 @@ class DS::Dialog < DesignSystemComponent end class_names( - "flex flex-col bg-container rounded-xl shadow-border-xs mx-3 lg:mx-0 w-full overflow-hidden", + "flex flex-col bg-container rounded-xl shadow-border-xs mx-3 lg:mx-0 w-full", variant_classes, content_class ) diff --git a/app/views/transactions/new.html.erb b/app/views/transactions/new.html.erb index f3fddcfdf..2e5573ac4 100644 --- a/app/views/transactions/new.html.erb +++ b/app/views/transactions/new.html.erb @@ -1,4 +1,4 @@ -<%= render DS::Dialog.new do |dialog| %> +<%= render DS::Dialog.new(scrollable: false) do |dialog| %> <% dialog.with_header(title: "New transaction") %> <% dialog.with_body do %> <%= render "form", entry: @entry, categories: @categories %> diff --git a/app/views/transfers/new.html.erb b/app/views/transfers/new.html.erb index db8b7d76a..68373153f 100644 --- a/app/views/transfers/new.html.erb +++ b/app/views/transfers/new.html.erb @@ -1,4 +1,4 @@ -<%= render DS::Dialog.new do |dialog| %> +<%= render DS::Dialog.new(scrollable: false) do |dialog| %> <% dialog.with_header(title: t(".title")) %> <% dialog.with_body do %> <%= render "form", transfer: @transfer %>