fix: always mount popover backdrop portal to prevent remount issues
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
330152fd5c
commit
e5e0918c93
1 changed files with 6 additions and 5 deletions
|
|
@ -26,8 +26,8 @@ const Popover = ({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{open &&
|
{createPortal(
|
||||||
createPortal(
|
open ? (
|
||||||
<div
|
<div
|
||||||
ref={backdropRef}
|
ref={backdropRef}
|
||||||
className="pointer-events-auto fixed inset-0 z-40"
|
className="pointer-events-auto fixed inset-0 z-40"
|
||||||
|
|
@ -35,7 +35,8 @@ const Popover = ({
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
handleOpenChange(false)
|
handleOpenChange(false)
|
||||||
}}
|
}}
|
||||||
/>,
|
/>
|
||||||
|
) : null,
|
||||||
document.body
|
document.body
|
||||||
)}
|
)}
|
||||||
<PopoverPrimitive.Root {...props} open={open} onOpenChange={handleOpenChange} modal={false} />
|
<PopoverPrimitive.Root {...props} open={open} onOpenChange={handleOpenChange} modal={false} />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue