fix: prevent default focus behavior on open and close events in sheet (#4998)

pull/5001/head
Huang Cheng Ting 2 months ago committed by GitHub
parent 76ca258f23
commit 5ba81d629c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -72,6 +72,13 @@ const SheetContent = React.forwardRef<
"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t", "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
className, className,
)} )}
onOpenAutoFocus={(e) => {
e.preventDefault();
}}
onCloseAutoFocus={(e) => {
e.preventDefault();
document.body.style.pointerEvents = "auto";
}}
{...props} {...props}
> >
{children} {children}

Loading…
Cancel
Save