diff --git a/src/renderer/src/components/ui/modal/stacked/modal.tsx b/src/renderer/src/components/ui/modal/stacked/modal.tsx index fc1ff77c1..2b8fc2927 100644 --- a/src/renderer/src/components/ui/modal/stacked/modal.tsx +++ b/src/renderer/src/components/ui/modal/stacked/modal.tsx @@ -67,6 +67,7 @@ export const ModalInternal = memo( resizeable = false, resizeDefaultSize, modal = true, + autoFocus = true, } = item const setStack = useSetAtom(modalStackAtom) @@ -243,6 +244,15 @@ export const ModalInternal = memo( }, [canClose, clickOutsideToDismiss, dismiss, modal, noticeModal], ) + + const openAutoFocus = useCallback( + (event: Event) => { + if (!autoFocus) { + event.preventDefault() + } + }, + [autoFocus], + ) useImperativeHandle(ref, () => modalElementRef.current!) if (CustomModalComponent) { return ( @@ -250,7 +260,7 @@ export const ModalInternal = memo( {title} - +
- +
(props: LinkProps } else { present({ ...basePresentProps, - + autoFocus: false, modalClassName: "relative mx-auto mt-[10vh] scrollbar-none max-w-full overflow-auto px-2 lg:max-w-[65rem] lg:p-0", // eslint-disable-next-line @eslint-react/no-nested-components