Skip to content

Commit cb7f274

Browse files
authored
prevent default behavior on handleAddItem (#1073)
1 parent 7f194ce commit cb7f274

File tree

1 file changed

+2
-1
lines changed
  • packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/ParamOptions/ParamFormItems

1 file changed

+2
-1
lines changed

packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ export default function ParamArrayFormItem({ param }: ParamProps) {
5656

5757
const showErrorMessage = errors?.paramArray?.message;
5858

59-
function handleAddItem() {
59+
function handleAddItem(e: any) {
60+
e.preventDefault(); // prevent form from submitting
6061
setItems((i) => [
6162
...i,
6263
{

0 commit comments

Comments
 (0)