apps icon indicating copy to clipboard operation
apps copied to clipboard

[examples/custom-validation] Set fields to invalid incorrect behaviour

Open stefankeil opened this issue 2 years ago • 7 comments

Describe the bug The example suggests to set entry fields to valid or invalid by settingsdk.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:

  1. use sdk.entry.fields['slug'].getForLocale(sdk.locales.default).setInvalid(true) https://github.com/contentful/apps/blob/5f7cd21064d5d06ee2683a7ee4b2faf70a49e625/examples/custom-validation/src/locations/Field.tsx#L25

Expected behavior Form Field should get invalid indicator (red bar…) In the example the slug field should get a red bar

Screenshots Screenshot 2023-07-05 at 11 47 02

Desktop (please complete the following information):

  • OS: Mac OS 13.4.1
  • Browser chrome 114.0.5735.198

stefankeil avatar Jul 05 '23 09:07 stefankeil

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.

whitelisab avatar Jul 12 '23 18:07 whitelisab

@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 😎

ghepting avatar Jul 13 '23 17:07 ghepting

Hi @ghepting , thanks for the update and for looking into it :)

stefankeil avatar Jul 17 '23 07:07 stefankeil