-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
🐛 Bug Report: scaffolder/next setting defaults doesn't always work #20055
Comments
Hey @benjdlambert - it was cool meeting you yesterday at BackstageCon. Was wondering if you could have a look at this, if you have a chance. We think it would be a blocker for being able to able to use scaffolder/next fully. Please let me know if I should provide more context. EDIT: Based on feedback from @nBerg, this seems to be a blocker for if/then. |
@benjdlambert Hey just bumping this again since I know you just got back from Kubecon and hoping to get this on your radar. Thanks! |
Hey @BryanSLam thanks for the callout. Yep this looks like it works in the upstream library just fine. So I wonder if #21328 is going to help here. |
Actually, I take that back, it doesn't work Looks like it works when there's no theme applied, but when we apply the material-ui theme it breaks. I think that this is an issue with the upstream library, and we should create an issue there instead. |
I made an issue: rjsf-team/react-jsonschema-form#3963 |
Turns out that it's a duplicate of another issue - I went ahead and created a PR to fix it: rjsf-team/react-jsonschema-form#3969 |
That's great! Thank you very much, @benjdlambert 🙏🏼 |
Thank you @benjdlambert! |
So the PR has been merged, however we'll want to create a PR to use the new options that was just released in 5.15. Does anyone want to whip up that PR? 🙏 |
@benjdlambert - thank you very much. Yes, of course, we're more than happy to open a PR. Could you just share a pointer on where to look? Does something like this suffice? |
Closing as fixed |
Hey there, I'm going to hijack this closed topic a bit because I found here what I was searching for. @nBerg mentioned in the code snippet
Is this intended or is there another solution that anyone knows of? |
📜 Description
I'm looking into switching over to scaffolder/next specifically to use the if/then syntax, but running into an issue where defaults are not respected for properties in the "then" block.
👍 Expected behavior
Defaults for properties in the "then" block should be set
👎 Actual Behavior with Screenshots
Default was not set as expected:
![Screenshot 2023-09-20 at 12 59 30 PM](https://private-user-images.githubusercontent.com/2374174/269362657-c8d1507c-73fe-4bcc-a882-f464ebadd9e2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU2Nzc0NDQsIm5iZiI6MTcyNTY3NzE0NCwicGF0aCI6Ii8yMzc0MTc0LzI2OTM2MjY1Ny1jOGQxNTA3Yy03M2ZlLTRiY2MtYTg4Mi1mNDY0ZWJhZGQ5ZTIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDdUMDI0NTQ0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDJhZjM4MmMxY2I2MTk3ZDE0NDc3NjZjZjA0ZGQ1MjcwMzM1YTY1MGIwYjY4ZmQzZDMwY2NiNjNiMDZmZmI4YyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.M0j_Lnbo2Lxbh24xNwXEjHDy4nzuGmMwnJ39zQsx4Qo)
👟 Reproduction steps
Here is an example of this working in the RJSF playground
Here is an example of a scaffolder template that does not work as expected:
📃 Provide the context for the Bug.
I'm trying to use the if/then syntax with defaults for some of the "then" properties. This works today using the "oneOf" syntax as described here. I'm looking into switching to scaffolder/next and using the if/else syntax for a few reasons, but primarily to fix this bug with duplicate validation errors.
🖥️ Your Environment
browser: Chrome Version 116.0.5845.187
👀 Have you spent some time to check if this bug has been raised before?
🏢 Have you read the Code of Conduct?
Are you willing to submit PR?
None
The text was updated successfully, but these errors were encountered: