v3: modals stop shifting the page — scroll lock moves to <html> and holds the scrollbar's gutter only while locked (and only if a bar was showing), shared by Modal and ConfirmModal with stacked-lock counting; scrollbars take a theme-tinted thumb, inner scrollers go thin and contain their overscroll
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 40s

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
khannurien
2026-09-19 21:12:19 +00:00
parent a9edd8fbb8
commit 5205097bb6
5 changed files with 50 additions and 8 deletions

View File

@@ -2,6 +2,7 @@ import { useEffect } from "react";
import { createPortal } from "react-dom";
import { t } from "@lingui/core/macro";
import { Trans } from "@lingui/react/macro";
import { useScrollLock } from "../hooks/useScrollLock";
interface ConfirmModalProps {
message: string;
@@ -14,6 +15,7 @@ export function ConfirmModal(
{ message, confirmLabel, onConfirm, onCancel }: ConfirmModalProps,
) {
const label = confirmLabel ?? t`Delete`;
useScrollLock();
useEffect(() => {
const onKey = (e: KeyboardEvent) => {