Fixed buttons not submitting on baseModal
This commit is contained in:
parent
4552fdcb53
commit
687c5a6cf4
2 changed files with 9 additions and 12 deletions
|
|
@ -87,7 +87,7 @@ export default function AddNewVariableButton({ children }): JSX.Element {
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
/>
|
/>
|
||||||
</BaseModal.Header>
|
</BaseModal.Header>
|
||||||
<BaseModal.Trigger>{children}</BaseModal.Trigger>
|
<BaseModal.Trigger asChild>{children}</BaseModal.Trigger>
|
||||||
<BaseModal.Content>
|
<BaseModal.Content>
|
||||||
<div className="flex h-full w-full flex-col gap-4 align-middle">
|
<div className="flex h-full w-full flex-col gap-4 align-middle">
|
||||||
<Label>Variable Name</Label>
|
<Label>Variable Name</Label>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { ReactNode, useEffect, useMemo } from "react";
|
import { ReactNode, useEffect } from "react";
|
||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import {
|
import {
|
||||||
|
|
@ -176,15 +176,12 @@ function BaseModal({
|
||||||
}
|
}
|
||||||
}, [open]);
|
}, [open]);
|
||||||
|
|
||||||
const modalContent = useMemo(
|
const modalContent = (
|
||||||
() => (
|
<>
|
||||||
<>
|
{headerChild}
|
||||||
{headerChild}
|
{ContentChild}
|
||||||
{ContentChild}
|
{ContentFooter && ContentFooter}
|
||||||
{ContentFooter && ContentFooter}
|
</>
|
||||||
</>
|
|
||||||
),
|
|
||||||
[headerChild, ContentChild, ContentFooter],
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const contentClasses = cn(
|
const contentClasses = cn(
|
||||||
|
|
@ -211,7 +208,7 @@ function BaseModal({
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
onSubmit();
|
onSubmit();
|
||||||
}}
|
}}
|
||||||
asChild
|
className="flex h-full flex-col gap-6"
|
||||||
>
|
>
|
||||||
{modalContent}
|
{modalContent}
|
||||||
</Form.Root>
|
</Form.Root>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue