rjsf-team/react-jsonschema-form
Default value doesn't work with if-else and array
開放
#3,869 建立於 2023年9月14日
bughelp wanted
倉庫指標
- 星標
- (13,175 顆星)
- PR 合併指標
- (平均合併 3天 17小時) (30 天內合併 32 個 PR)
描述
Prerequisites
- I have searched the existing issues
- I understand that providing a SSCCE example is tremendously useful to the maintainers.
- I have read the documentation
- Ideally, I'm providing a sample JSFiddle, Codesandbox.io or preferably a shared playground link demonstrating the issue.
What theme are you using?
core
Version
5.6.2
Current Behavior
If there's an object with keys "foo" and "bar" and when "foo" is true, "bar" should added with default value true. If the schema contains just this object, the default value is added. But if the object is wrapped in an array, the default is not added.
Expected Behavior
Also when the object is inside an array, the default should be added for the object.
Steps To Reproduce
Here's a schema for an object with keys "foo" and "bar" and when "foo" is true, "bar" is added with default value true. Works fine: Link to Playground
Here's the same schema, but wrapped in an array. Default doesn't work. Link to Playground