Unable to pass a boolean input to readOnly (@rjsf/bootstrap-4)
See original GitHub issuePrerequisites
- I have read the documentation;
- In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.
- Ideally, I’m providing a sample JSFiddle or a shared playground link demonstrating the issue.
Description
Cannot pass a boolean input to readOnly with de Bootstrap4 theme but it is possible with MaterialUI theme.
Steps to Reproduce
Imports
import React from "react";
import { Theme as Bootstrap4Theme } from "@rjsf/bootstrap-4";
import {
withTheme
} from "@rjsf/core";
Code
const JsonSchemaForm = withTheme(Bootstrap4Theme);
return (
<div style={{ position: "relative" }}>
<JsonSchemaForm
schema={{
"title": "Entité",
"type": "object",
"properties": {
"@id": {
"type": "string",
"title":"ID"
},
"nom": {
"type": "string",
"title":"Nom"
},
"prenom": {
"type": "string"
},
"email": {
"type": "string"
},
"age": {
"type": "number"
},
"sdf": {
"type": "boolean"
}
},
"required": ["@id", "nom", "prenom", "email", "age", "sdf"]
}}
uiSchema={ {
nom: {"ui:readonly": true},
sdf: {"ui:readonly": true}
}
}
/>
</JsonSchemaForm>
);
Expected behavior
Have the input read only as the MaterialUI theme
Screenshot (materialUI theme):
Actual behavior
Simple boolean input
Screenshot (bootstrap theme)
Version
“@rjsf/bootstrap-4”: “^2.4.2” “@rjsf/core”: “^2.3.0” “@rjsf/material-ui”: “^2.3.0”
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
unable to pass boolean value - html - Stack Overflow
I have a form field/checkbox and am unable to pass the boolean value even though it is selected. <input type="checkbox" name ...
Read more >Unable to pass boolean value False through --extra-vars ...
Running playbook with passing foobar=True as extra-vars parameter works as expected.
Read more >boolean variable to boolean parameter
Hi,. I'm unable to pass a boolean variable to a boolean parameter, I always have this error message "is not a valid boolean",...
Read more >How To Use HTML5 Input Types | DigitalOcean
Let's go over all the possible HTML input types; from the default text input, ... readonly - boolean whether the input should be...
Read more >What is wrong with boolean parameters?
Working with Legacy Code, it's not uncommon to come across boolean parameters. ... 2 booleans would create an eventual 4th “impossible” state that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@paintedbicycle I tried again (still on gitpod) and this time it worked. I didn’t change a thing: Fresh clone, fresh dev env, node v14.16.0, npm v6.14.11.
@epicfaace in my newly working workspace the version of @types/json-schema are different in material-ui and core:
@epicfaace Yup, that was it. PR here: https://github.com/rjsf-team/react-jsonschema-form/pull/2310