fix(dialog): prevent both open and close auto focus to avoid page scroll (#317)

Add onOpenAutoFocus handler to prevent Radix Dialog from auto-focusing
content on open, which can cause unwanted scroll behavior.
This commit is contained in:
sagit
2026-03-14 09:38:09 +08:00
committed by GitHub
parent e194813f3b
commit 05c3b5842e
2 changed files with 7 additions and 1 deletions
@@ -158,6 +158,9 @@ export function ModalContent({
className,
)}
showCloseButton={false}
onOpenAutoFocus={(e) => {
e.preventDefault();
}}
onCloseAutoFocus={(e) => {
e.preventDefault();
}}