Update web/app/components/base/markdown-blocks/form.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
pull/21922/head
mizoo 11 months ago committed by GitHub
parent 1d14d334d5
commit 9feeb82ba8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -39,11 +39,10 @@ const MarkdownForm = ({ node }: any) => {
const initialValues: { [key: string]: any } = {} const initialValues: { [key: string]: any } = {}
node.children.forEach((child: any) => { node.children.forEach((child: any) => {
if ([SUPPORTED_TAGS.INPUT, SUPPORTED_TAGS.TEXTAREA].includes(child.tagName)) { if ([SUPPORTED_TAGS.INPUT, SUPPORTED_TAGS.TEXTAREA].includes(child.tagName)) {
if (child.tagName === SUPPORTED_TAGS.INPUT && child.properties.type === SUPPORTED_TYPES.HIDDEN) { initialValues[child.properties.name] =
initialValues[child.properties.name] = child.properties.value || '' (child.tagName === SUPPORTED_TAGS.INPUT && child.properties.type === SUPPORTED_TYPES.HIDDEN)
} else { ? (child.properties.value || '')
initialValues[child.properties.name] = child.properties.value : child.properties.value
}
} }
}) })
setFormValues(initialValues) setFormValues(initialValues)

Loading…
Cancel
Save