Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bootstrap-4] [CheckboxesWidget] - <form> cannot appear as a descendant of <form> #2355

Closed
3 tasks done
kubajal opened this issue May 1, 2021 · 1 comment · Fixed by #3145
Closed
3 tasks done
Labels
bootstrap-4 bootstrap-4 related theme issue bug

Comments

@kubajal
Copy link

kubajal commented May 1, 2021

Prerequisites

Link to the JSFiddle: https://jsfiddle.net/cuq1y8n7/7/ (just copy & paste it locally)

Description

A minimal example of CheckboxesWidget from @rjsf/bootstrap-4 causes the error: <form> cannot appear as a descendant of <form>.

Steps to Reproduce

  1. Create the following app:
import Form from "@rjsf/bootstrap-4";
[...]
const custom_schema = {
  type: "object",
  properties: {
    arrayTest: {
    	type: "array",
      items: {
      	type: "string",
        enum: ["1", "2", "3"]
      },
      uniqueItems: true
    }
  }
};
const custom_uiSchema = {
  arrayTest: {
  	"ui:widget": "checkboxes"
  }
[...]
ReactDOM.render(<Form schema={custom_schema} uiSchema={custom_uiSchema}/>, 
             document.getElementById("root"));
  1. run the app: npm start

Expected behavior

The checkboxes should be rendered without errors.

Actual behavior

The checkboxes are rendered but the console reads:

index.js:1 Warning: validateDOMNesting(...): <form> cannot appear as a descendant of <form>.
    at form
    at http://localhost:3000/static/js/vendors~main.chunk.js:50226:23
    at div
    at http://localhost:3000/static/js/vendors~main.chunk.js:50825:23
    at CheckboxesWidget (http://localhost:3000/static/js/vendors~main.chunk.js:5438:21)
    at Widget.MergedWidget (http://localhost:3000/static/js/vendors~main.chunk.js:11115:33)
    at ArrayField (http://localhost:3000/static/js/vendors~main.chunk.js:6932:102)
    at div
    at http://localhost:3000/static/js/vendors~main.chunk.js:50825:23
    at FieldTemplate (http://localhost:3000/static/js/vendors~main.chunk.js:5319:17)
    at SchemaField (http://localhost:3000/static/js/vendors~main.chunk.js:8905:102)
    at div
    at http://localhost:3000/static/js/vendors~main.chunk.js:50037:23
    at div
    at http://localhost:3000/static/js/vendors~main.chunk.js:51234:23
    at div
    at http://localhost:3000/static/js/vendors~main.chunk.js:50107:23
    at ObjectFieldTemplate (http://localhost:3000/static/js/vendors~main.chunk.js:5345:31)
    at ObjectField (http://localhost:3000/static/js/vendors~main.chunk.js:8257:102)
    at div
    at http://localhost:3000/static/js/vendors~main.chunk.js:50825:23
    at FieldTemplate (http://localhost:3000/static/js/vendors~main.chunk.js:5319:17)
    at SchemaField (http://localhost:3000/static/js/vendors~main.chunk.js:8905:102)
    at form
    at Form (http://localhost:3000/static/js/vendors~main.chunk.js:6177:102)
    at http://localhost:3000/static/js/vendors~main.chunk.js:12559:23

Version

"@rjsf/bootstrap-4": "^2.5.1",
"@rjsf/core": "^2.5.1",
@jacqueswho jacqueswho added bootstrap-4 bootstrap-4 related theme issue bug labels Feb 23, 2022
@heath-freenome
Copy link
Member

Fixed in v5 beta via #3145

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bootstrap-4 bootstrap-4 related theme issue bug
Projects
None yet
3 participants