-
Notifications
You must be signed in to change notification settings - Fork 150
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
[examples/custom-validation] Set fields to invalid incorrect behaviour #3992
Comments
Hi @stefankeil! Thank you for notifying us of this issue. I have logged a ticket with our Developer Experience Team and they will look into it further. |
@stefankeil FYI we're still working on figuring out how to fix this. There's a 3+ year old comment that indicates this has never worked FWIW, but I'm determined to figure out a way 😎 |
Hi @ghepting , thanks for the update and for looking into it :) |
Hi @ghepting , Any fix on the issue ? |
i'm too experiencing that custom_validation can indeed notify the user that the field doesn't pass validation, however, it doesn't block/prevent publishing. Is there a way to utilize setInvalid(true) or setInvalid(false) in order to prevent publishing? they don't do anything for us currently. Thanks |
Describe the bug
The example suggests to set entry fields to valid or invalid by setting
sdk.entry.fields[...].getForLocale(...).setInvalid(true)
. According to the sdk docs, this actually just works on the field location.To Reproduce
Steps to reproduce the behavior:
sdk.entry.fields['slug'].getForLocale(sdk.locales.default).setInvalid(true)
apps/examples/custom-validation/src/locations/Field.tsx
Line 25 in 5f7cd21
Expected behavior
Form Field should get invalid indicator (red bar…)
In the example the
slug
field should get a red barScreenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: