From c58432a9bdf8c4d00d895bfed76f084835d54288 Mon Sep 17 00:00:00 2001 From: Steven Serrata Date: Wed, 29 Jan 2025 11:01:33 -0500 Subject: [PATCH] prevent default behavior on handleAddItem --- .../ParamOptions/ParamFormItems/ParamArrayFormItem.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx b/packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx index d28430f92..674cc0889 100644 --- a/packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx +++ b/packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx @@ -56,7 +56,8 @@ export default function ParamArrayFormItem({ param }: ParamProps) { const showErrorMessage = errors?.paramArray?.message; - function handleAddItem() { + function handleAddItem(e: any) { + e.preventDefault(); // prevent form from submitting setItems((i) => [ ...i, {