ui: fix card modal from staying open

This commit is contained in:
nick-delirium 2025-02-20 17:58:19 +01:00
parent bf56cc53a7
commit 5dd1256cd3
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0

View file

@ -22,6 +22,10 @@ type Props = IProps & RouteComponentProps;
function DashboardHeader(props: Props) {
const { siteId } = props;
const [popoverOpen, setPopoverOpen] = React.useState(false);
const handleOpenChange = (open: boolean) => {
setPopoverOpen(open);
};
const { dashboardStore } = useStore();
const [focusTitle, setFocusedInput] = React.useState(true);
const [showEditModal, setShowEditModal] = React.useState(false);
@ -82,7 +86,9 @@ function DashboardHeader(props: Props) {
<Popover
trigger="click"
content={<AddCardSection />}
open={popoverOpen}
onOpenChange={handleOpenChange}
content={<AddCardSection handleOpenChange={handleOpenChange} />}
overlayInnerStyle={{ padding: 0, borderRadius: '0.75rem' }}
>
<Button type="primary" icon={<PlusOutlined />} size="middle">