🐛 fix(formModal/index.tsx): stop propagation of click event at the toggle component
This commit is contained in:
parent
54b5aa65da
commit
5520ecea7a
1 changed files with 62 additions and 54 deletions
|
|
@ -403,12 +403,12 @@ export default function FormModal({
|
|||
<div className="flex justify-between items-center">
|
||||
<div className="flex py-2">
|
||||
<Variable className="w-6 h-6 pe-1 text-gray-700 stroke-2 dark:text-slate-200"></Variable>
|
||||
<span className="text-md font-semibold text-gray-800 dark:text-white">
|
||||
<span className="text-md font-semibold text-primary">
|
||||
Input Variables
|
||||
</span>
|
||||
</div>
|
||||
<span className="mr-7 text-sm font-semibold text-gray-800 dark:text-white">
|
||||
Chat
|
||||
<span className="mr-2 text-md font-semibold text-primary">
|
||||
Chat Input
|
||||
</span>
|
||||
</div>
|
||||
<Accordion type="single" collapsible className="w-full">
|
||||
|
|
@ -422,7 +422,12 @@ export default function FormModal({
|
|||
{i}
|
||||
</Badge>
|
||||
|
||||
<div className="-mb-1">
|
||||
<div
|
||||
className="-mb-1"
|
||||
onClick={(event) => {
|
||||
event.stopPropagation();
|
||||
}}
|
||||
>
|
||||
<ToggleShadComponent
|
||||
enabled={chatKey === i}
|
||||
setEnabled={(value) =>
|
||||
|
|
@ -430,14 +435,15 @@ export default function FormModal({
|
|||
}
|
||||
size="small"
|
||||
disabled={false}
|
||||
/></div>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</AccordionTrigger>
|
||||
<AccordionContent>
|
||||
<div className="p-1 flex flex-col gap-2">
|
||||
{tabsState[id.current].formKeysData.handle_keys.some(
|
||||
(t) => t === i
|
||||
) ? (
|
||||
{tabsState[
|
||||
id.current
|
||||
].formKeysData.handle_keys.some((t) => t === i) ? (
|
||||
<div className="font-normal text-muted-foreground ">
|
||||
Handle
|
||||
</div>
|
||||
|
|
@ -452,13 +458,16 @@ export default function FormModal({
|
|||
if (
|
||||
!tabsState[
|
||||
id.current
|
||||
].formKeysData.handle_keys.some((t) => t === i)
|
||||
].formKeysData.handle_keys.some(
|
||||
(t) => t === i
|
||||
)
|
||||
)
|
||||
setTabsState((old) => {
|
||||
let newTabsState = _.cloneDeep(old);
|
||||
newTabsState[
|
||||
id.current
|
||||
].formKeysData.input_keys[i] = e.target.value;
|
||||
].formKeysData.input_keys[i] =
|
||||
e.target.value;
|
||||
return newTabsState;
|
||||
});
|
||||
}}
|
||||
|
|
@ -468,7 +477,6 @@ export default function FormModal({
|
|||
</div>
|
||||
</AccordionContent>
|
||||
</AccordionItem>
|
||||
|
||||
</div>
|
||||
)
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue