UI: Scroll to top when opening new NS API doc page in popup mode (#2181)

This commit is contained in:
catloversg
2025-06-26 03:24:18 +07:00
committed by GitHub
parent d7642b34d0
commit e3968a1fb9
4 changed files with 30 additions and 17 deletions
+3
View File
@@ -43,6 +43,7 @@ interface ModalProps {
onClose: () => void;
children: React.ReactNode;
sx?: SxProps<Theme>;
wrapperRef?: React.RefObject<HTMLDivElement>;
wrapperStyles?: CSSProperties;
removeFocus?: boolean;
// If it's true, the player can dismiss the modal by pressing the Esc button or clicking on the backdrop.
@@ -54,6 +55,7 @@ export const Modal = ({
onClose,
children,
sx,
wrapperRef,
wrapperStyles,
removeFocus = true,
canBeDismissedEasily = true,
@@ -84,6 +86,7 @@ export const Modal = ({
>
<Fade in={open}>
<div
ref={wrapperRef}
className={classes.paper}
style={wrapperStyles}
//@ts-expect-error inert is not supported by react types yet, this is a workaround until then. https://github.com/facebook/react/pull/24730