mirror of
https://github.com/tale/headplane.git
synced 2026-07-26 07:48:14 +00:00
fix(dialog): stop clipping focus rings in scrollable content
#556 added overflow-y-auto to the dialog content container. Per the CSS spec, when one overflow axis is non-visible the other resets from visible to auto, so overflow-x was being silently clamped too — clipping the ~2px focus ring on inputs/buttons against the left edge of the container. Add px-1/-mx-1 so the layout width is unchanged while focus rings get room to render. Amp-Thread-ID: https://ampcode.com/threads/T-019e7ae4-6862-760c-a3e7-239350eab71d Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -79,7 +79,12 @@ function Panel(props: DialogPanelProps) {
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div className="flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto">{children}</div>
|
||||
{/* px-1 -mx-1 gives focus rings on inputs/buttons room to render
|
||||
without being clipped by overflow-y-auto (which implicitly forces
|
||||
overflow-x: auto per CSS spec). */}
|
||||
<div className="-mx-1 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-1">
|
||||
{children}
|
||||
</div>
|
||||
<div className="mt-5 flex shrink-0 justify-end gap-3">
|
||||
{variant === "unactionable" ? (
|
||||
<AlertDialog.Close render={<Button>Close</Button>} />
|
||||
|
||||
Reference in New Issue
Block a user