react-admin icon indicating copy to clipboard operation
react-admin copied to clipboard

[PROPOSAL] Validation on non material-ui components

Open Natsuke opened this issue 9 years ago • 6 comments

Hi guys,

At this time non-material-ui don't display any validation error. This is quite bad for UX, as you can submit a form and get no return.

We can for instance,

  • Turn the Labeled component text red
  • ...

Natsuke avatar Mar 15 '17 12:03 Natsuke

+1 I mentioned the same for BooleanInputs (here: https://github.com/marmelab/admin-on-rest/issues/439), didn't know it was the case for other inputs !

EDIT: my bad for https://github.com/marmelab/admin-on-rest/issues/439 , adding a defaultValue does the job I wanted to be done

remi13131 avatar Mar 15 '17 14:03 remi13131

Please be more specific and list the inputs that don't show validation errors.

We'll display them in a similar way as for material-ui components.

fzaninotto avatar Mar 15 '17 17:03 fzaninotto

Any updates on this one?

fzaninotto avatar Mar 21 '17 17:03 fzaninotto

No news for some time, closing.

fzaninotto avatar Apr 05 '17 12:04 fzaninotto

@fzaninotto I came across this issue while looking for a solution to display validation errors on custom inputs. As far as I see there is no convenient way to display errors on custom inputs at all.

When not using the Labeled component I have the meta props on my custom component, so I might build some sort of visualization when the error field contains something. But when using the Labeledcomponent it "omits" the meta prop. So I can't use it in my custom component.

But in my opinion it should be the Labeled components job to display any validation errors.

What do you think?

nik-lampe avatar Aug 17 '17 05:08 nik-lampe

This will be fixed by material-ui 1.0, which offers atomic components for label, errors, etc. In the meantime, you'll have to do it by hand.

fzaninotto avatar Aug 20 '17 12:08 fzaninotto