diff --git a/resources/css/app.css b/resources/css/app.css index 62f718b79..fcb97b814 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -1939,27 +1939,7 @@ html[data-theme="custom"] textarea:disabled { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); } -.floating-dropdown-panel { - min-width: 0; -} - -/* Older menus still render inside their page container. On mobile, keep - those panels fully visible until they are migrated to the portaled - dropdown component. Portaled panels carry their own fixed coordinates. */ @media (max-width: 767px) { - .listbox-panel:not([style*="position: fixed"]) { - position: fixed !important; - top: 50% !important; - right: auto !important; - left: 50% !important; - width: max-content; - max-width: calc(100vw - 1.5rem) !important; - max-height: calc(100dvh - 1.5rem) !important; - box-sizing: border-box; - transform: translate(-50%, -50%) !important; - z-index: 9999 !important; - } - /* The mobile top bar's backdrop filter makes it the containing block for fixed descendants. Keep this menu anchored below its trigger instead of centering it within the short top bar. */ diff --git a/resources/views/components/dropdown.blade.php b/resources/views/components/dropdown.blade.php index d466f3907..b48b04143 100644 --- a/resources/views/components/dropdown.blade.php +++ b/resources/views/components/dropdown.blade.php @@ -25,10 +25,13 @@ const triggerRect = this.$refs.trigger.getBoundingClientRect(); const panelRect = this.$refs.panel.getBoundingClientRect(); const viewportPadding = 8; - const left = Math.max( - viewportPadding, - (window.innerWidth - panelRect.width) / 2, - ); + let left = triggerRect.left; + + if ((left + panelRect.width + viewportPadding) > window.innerWidth) { + left = window.innerWidth - panelRect.width - viewportPadding; + } + + left = Math.max(viewportPadding, left); let top = triggerRect.bottom + 4; const maxTop = window.innerHeight - panelRect.height - viewportPadding; diff --git a/resources/views/components/floating-dropdown-script.blade.php b/resources/views/components/floating-dropdown-script.blade.php deleted file mode 100644 index 81381c5cd..000000000 --- a/resources/views/components/floating-dropdown-script.blade.php +++ /dev/null @@ -1,69 +0,0 @@ - diff --git a/resources/views/components/forms/listbox.blade.php b/resources/views/components/forms/listbox.blade.php index 22e1865de..bfcb4437e 100644 --- a/resources/views/components/forms/listbox.blade.php +++ b/resources/views/components/forms/listbox.blade.php @@ -14,7 +14,7 @@ 'value' => null, // initial value when wire=false 'disabled' => false, 'tooltip' => true, - 'portal' => true, + 'portal' => false, 'preserveValue' => false, ]) @@ -43,13 +43,9 @@ @endif @endif -