RA v4 blocks validation due to empty array
See original GitHub issueWhat you were expecting: Before RA v4, returning an empty array from the validator meant that RA treated the form as being valid. After the new update it seems that this is no longer the case, and we get a popup saying that form isn’t valid.
Not sure if this is a bug, or if it’s new behaviour that needs to be documented.
You can test this out here
You can enter some text into the array field.
If the value is less than 2 characters, it will add an array to the backlinks’ error array. if it’s larger, then it’ll just return the empty array.
What do you suggest, is this a bug or just a change in behaviour?
What happened instead:
Steps to reproduce:
Related code:
- Preferably, a CodeSandbox forked from https://codesandbox.io/s/github/marmelab/react-admin/tree/next/examples/simple
- A link to a GitHub repo with the minimal codebase to reproduce the issue
insert short code snippets here
Other information:
Environment
- React-admin version:
- Last version that did not exhibit the issue (if applicable):
- React version:
- Browser:
- Stack trace (in case of a JS error):
Issue Analytics
- State:
- Created a year ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Joi array validation: allow empty array
No, it doesn't require any item. You can use an empty array. If you want at least one item to be present, you...
Read more >2023 Toyota RAV4 for Sale in Lewiston, ID
Visit Rogers Toyota of Lewiston to see the 2023 Toyota RAV4 for sale in Lewiston, ID, near Clarkston, WA, up close and personal....
Read more >2019 Toyota RAV4 Problems: An Overall Reliable SUV ...
2019 RAV4 has had several problems such as recalls, odd shifting behavior, trouble with fuel levels, and a nagging fuel pump issue.
Read more >2023 Toyota RAV4 Prime for Sale in Hermiston, OR
Visit Rogers Toyota of Hermiston to see the 2023 Toyota RAV4 Prime for sale in Hermiston, OR, near Pendleton, OR, up close and...
Read more >New RAV4 Cars for Sale in Tampa Bay FL
we want to offer you a special Incentive. $25 VISA® REWARD CARD Test Drive Req'd - No Purchase Necessary. Get Offer.
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
@fzaninotto, I don’t think @andrico1234 read it anywhere, he is just implying that react-final-form allowed this “undocumented” behavior, and now react-admin v4 doesn’t.
OK, I didn’t manage to do it in 5 minutes, so I’ll let it open for anyone willing to try. The solution probably comes from https://github.com/lodash/lodash/issues/2240.