From a794dd48ec184595a0dc24417f5f72276dc55c09 Mon Sep 17 00:00:00 2001 From: Wilhelm Svensgaard Rolstad Date: Thu, 12 Nov 2026 19:39:28 +0100 Subject: [PATCH 1/2] bugfix: notifications were modal restricting scrolll, now it is not --- .../src/components/SuccessNotification.tsx | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/SuccessNotification.tsx b/frontend/src/components/SuccessNotification.tsx index bef99b9..ee90cc0 100644 --- a/frontend/src/components/SuccessNotification.tsx +++ b/frontend/src/components/SuccessNotification.tsx @@ -14,30 +14,31 @@ export default function SuccessNotification({ onClose, action, }: SuccessNotificationProps) { - const dialogRef = useRef(null); + const notificationRef = useRef(null); const titleId = useId(); const descriptionId = useId(); useEffect(() => { - const dialog = dialogRef.current; - if (!dialog) return; - dialog.showModal(); + const notification = notificationRef.current; + if (!notification) return; + // Stay above the page without locking scrolling or moving keyboard focus. + notification.showPopover(); let exitAnimation: Animation | undefined; const timer = window.setTimeout(() => { - if (!dialog.open) return; + if (!notification.matches(":popover-open")) return; if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) { - dialog.close(); + notification.hidePopover(); return; } - exitAnimation = dialog.animate( + exitAnimation = notification.animate( [ { transform: "translateX(0)", opacity: 1 }, { transform: "translateX(calc(100% + 1rem))", opacity: 0 }, ], { duration: 250, easing: "ease-in", fill: "forwards" }, ); - exitAnimation.onfinish = () => dialog.close(); + exitAnimation.onfinish = () => notification.hidePopover(); }, 5000); return () => { window.clearTimeout(timer); @@ -46,16 +47,19 @@ export default function SuccessNotification({ }, []); return ( - { + if (event.newState === "closed") onClose(); + }} aria-labelledby={titleId} aria-describedby={descriptionId} className="fixed right-4 left-auto top-20 bottom-auto m-0 h-fit max-h-[calc(100dvh-2rem)] w-[calc(100%-2rem)] max-w-sm overflow-y-auto rounded-2xl border border-surface bg-background p-0 text-white shadow-lg shadow-black/20 backdrop:bg-transparent motion-safe:animate-[feedback-slide-in_250ms_ease-out]" > + ); } From 28055593ffde6f7baa18bd17b5a7a264d3acc561 Mon Sep 17 00:00:00 2001 From: Wilhelm Svensgaard Rolstad Date: Thu, 12 Nov 2026 19:41:25 +0100 Subject: [PATCH 2/2] removed unused import --- frontend/src/components/buttons/AddToBuildButton.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/components/buttons/AddToBuildButton.tsx b/frontend/src/components/buttons/AddToBuildButton.tsx index 808cb11..8107348 100644 --- a/frontend/src/components/buttons/AddToBuildButton.tsx +++ b/frontend/src/components/buttons/AddToBuildButton.tsx @@ -2,7 +2,6 @@ import type { ReactNode } from "react"; import { useRef, useState } from "react"; import type { PcPart } from "@/types/types"; import { useBuild } from "@/context/BuildContext"; -import { useNavigate } from "react-router"; import { twMerge } from "tailwind-merge"; import Button from "./Button"; import AddToBuildFeedback from "../AddToBuildFeedback";