mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-01 08:36:38 +08:00
fix(dialog): prevent auto focus restore on close to avoid page scroll (#315)
When a modal is closed, Radix Dialog by default restores focus to the trigger element. This causes the page to scroll to that element if it's not in the viewport, leading to unexpected scrolling behavior after editing forwards or other items. Entire-Checkpoint: 78b48b74a841
This commit is contained in:
@@ -61,6 +61,9 @@ function DialogContent({
|
||||
className,
|
||||
)}
|
||||
data-slot="dialog-content"
|
||||
onCloseAutoFocus={(e) => {
|
||||
e.preventDefault();
|
||||
}}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
|
||||
Reference in New Issue
Block a user