From 92e560bef6ca695de3ef3f2614cefaac2a8ca9be Mon Sep 17 00:00:00 2001 From: Andreas Reinhold / reini Date: Wed, 16 Sep 2026 20:21:24 +0200 Subject: [PATCH] Slide the navigation rail and fade its scrim out in Firefox too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A rail that was open over the page left it on `transition: … display … allow-discrete`: the compact adaptive rail's slide-out, the slide-out of a rail that hides when collapsed, and every rail scrim's fade. Firefox does not transition `display`, even with `allow-discrete` (Chrome 117 and Safari 18 do), so there the panel and the scrim vanished on the first frame. Unlike the sheets' scrims these are drawn by attribute rules on `data-md-open`, not `x-show`, so Alpine had nothing to hold. navigation.js now marks a rail that closes `data-md-closing` — `sheet` when the panel leaves the window, `scrim` when it stands in the layout again — and drops it once the panel's `translate` and the scrim's `opacity` transitions have finished (at once under reduced motion, or when the rail opens again). navigation-rail.css keeps what is leaving displayed, and a sliding panel in its open geometry, while the attribute is set, and no longer transitions `display` anywhere, so Chrome and Safari do not hold a second time. The view sets it from `x-effect`, beside the `x-bind` that drops `data-md-open`, so both attributes change in one flush: a `$watch` a microtask later let a style read in between settle the scrim as already hidden. The collapsed branches and `--md-navigation-rail-value` are untouched. NavigationTest samples each exit part-way in the page (the compact slide, the hide-when-collapsed slide, a modal rail's scrim) and checks it ends hidden; all three fail on main in Firefox and pass in Chrome, Firefox and Safari. They wait for the entry to finish first: Firefox creates a transition on its next refresh tick, so straight after a change its computed style already reads the end value. NavigationRailTest pins the holds and that no rule transitions `display`. Co-Authored-By: Claude Opus 5 (1M context) --- resources/css/components/navigation-rail.css | 70 ++++++++++----- resources/js/navigation.js | 58 ++++++++++++- .../components/navigation-rail.blade.php | 9 +- tests/Browser/NavigationTest.php | 87 +++++++++++++++++++ .../Feature/Components/NavigationRailTest.php | 32 ++++++- 5 files changed, 226 insertions(+), 30 deletions(-) diff --git a/resources/css/components/navigation-rail.css b/resources/css/components/navigation-rail.css index a67847b2..7f2b5089 100644 --- a/resources/css/components/navigation-rail.css +++ b/resources/css/components/navigation-rail.css @@ -6,7 +6,8 @@ * docs/reference/m3/components-navigation-selection-inputs.md § Navigation Rail). * * [data-md-navigation-rail="collapsed|expanded|collapsible|modal|adaptive"] data-md-open - * [data-md-navigation-rail-scrim] modal and adaptive rails, open only + * data-md-closing="sheet|scrim", while it exits + * [data-md-navigation-rail-scrim] modal and adaptive rails, open or closing only * [data-md-navigation-rail-panel] the