fixing baseform table edit
This commit is contained in:
parent
cb28c0fe82
commit
bc73112e50
|
|
@ -14,7 +14,7 @@ export type BaseFormProps<T> = {
|
|||
onSubmit?: (arg: { fm: FMLocal }) => Promise<boolean> | boolean;
|
||||
onChange?: (fm: FMLocal, name: string, new_value: any) => any;
|
||||
children: ReactNode | ((arg: { fm: FMLocal }) => ReactNode);
|
||||
tag?: "form" | "div";
|
||||
tag?: "form" | "div" | "blank";
|
||||
};
|
||||
|
||||
export const BaseForm = <T extends Record<string, any>>({
|
||||
|
|
@ -73,6 +73,10 @@ export const BaseForm = <T extends Record<string, any>>({
|
|||
}
|
||||
const toaster_el = document.getElementsByClassName("prasi-toaster")[0];
|
||||
|
||||
if (tag === "blank") {
|
||||
return child;
|
||||
}
|
||||
|
||||
return (
|
||||
<DivForm
|
||||
tag={tag || "form"}
|
||||
|
|
|
|||
|
|
@ -274,14 +274,14 @@ export const TableEdit: FC<{
|
|||
<BaseForm
|
||||
key={idx}
|
||||
name={`tef-${idx}`}
|
||||
tag={"div"}
|
||||
tag={"blank"}
|
||||
data={row}
|
||||
>
|
||||
{(form) => {
|
||||
return (
|
||||
<tr
|
||||
className={cx(
|
||||
"c-border-b c-py-1",
|
||||
"c-border-t",
|
||||
idx !== value.length - 1
|
||||
? "c-border-gray-300"
|
||||
: ""
|
||||
|
|
@ -291,6 +291,7 @@ export const TableEdit: FC<{
|
|||
return (
|
||||
<td
|
||||
className={cx(
|
||||
"c-py-1",
|
||||
css`
|
||||
vertical-align: top;
|
||||
`,
|
||||
|
|
|
|||
Loading…
Reference in New Issue