TryGhost
OSS
Ghost
Fixed the inert background-lock never actually activating ref https://linear.app/ghost/issue/NY-1394/ - while responding to a CodeRabbit review comment on the previous commit, found that the effect making the background admin UI inert while the email editor is open was a silent no-op: dialogContentRef was a plain useRef, but Radix's Portal primitive renders null on its first pass and only mounts the real DOM node one render later (via its own useLayoutEffect, an SSR-safety trick since document isn't available server-side) — so dialogContentRef.current was still null by the time our effect ran, it bailed out immediately, and with an empty dependency array it never got a second chance - verified via devtools: document.querySelectorAll('[inert]') returned nothing before this fix, meaning the background was fully focusable/clickable the entire time the modal was open - fixed by tracking the node as state via a callback ref instead of a plain ref, so the effect re-runs once Radix actually attaches it - this also let us properly re-test CodeRabbit's suggestion of adding a MutationObserver to catch late-mounting body children: with the inert-lock actually working, that suggestion does break the stacked discard-confirm AlertDialog, confirming it shouldn't be applied
nx run ghost:build:assets
Sign in / Sign up
Open main menu
Succeeded
CI Pipeline Execution
nx run ghost:build:assets
Click to copy
Linux
4 CPU cores
read-write
access token used
3ce391b1
29176