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"
|
||||
/>
|
||||
</BaseModal.Header>
|
||||
<BaseModal.Trigger>{children}</BaseModal.Trigger>
|
||||
<BaseModal.Trigger asChild>{children}</BaseModal.Trigger>
|
||||
<BaseModal.Content>
|
||||
<div className="flex h-full w-full flex-col gap-4 align-middle">
|
||||
<Label>Variable Name</Label>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { ReactNode, useEffect, useMemo } from "react";
|
||||
import { ReactNode, useEffect } from "react";
|
||||
|
||||
import React from "react";
|
||||
import {
|
||||
|
|
@ -176,15 +176,12 @@ function BaseModal({
|
|||
}
|
||||
}, [open]);
|
||||
|
||||
const modalContent = useMemo(
|
||||
() => (
|
||||
<>
|
||||
{headerChild}
|
||||
{ContentChild}
|
||||
{ContentFooter && ContentFooter}
|
||||
</>
|
||||
),
|
||||
[headerChild, ContentChild, ContentFooter],
|
||||
const modalContent = (
|
||||
<>
|
||||
{headerChild}
|
||||
{ContentChild}
|
||||
{ContentFooter && ContentFooter}
|
||||
</>
|
||||
);
|
||||
|
||||
const contentClasses = cn(
|
||||
|
|
@ -211,7 +208,7 @@ function BaseModal({
|
|||
event.preventDefault();
|
||||
onSubmit();
|
||||
}}
|
||||
asChild
|
||||
className="flex h-full flex-col gap-6"
|
||||
>
|
||||
{modalContent}
|
||||
</Form.Root>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue