contember / interface-archive

Archive of Contember Interface 1.x.
Other
94 stars 7 forks source link

Add red star marking the element required to more elements #438

Closed Thommas2316 closed 1 year ago

Thommas2316 commented 2 years ago

Hi all,

not long time ago I created issue #381 which David fixed already. However, I found few more elements that are missing this flag. I'd like to try to send a PR with fix, just need to ask this, so I know I'm not out my depths here :D

Would it be ok to just (in cargo-cult manner) just add required={props.required} to FieldContainer (where props do carry this info ofc) as David did in his PR ? Or does it trigger some behavior on the element that I need to watch out for ? Like, for instance, if required prop is set on FieldContainer it tries to trigger some sort of validation of children, that not all children can fulfill...

If the task is only about propagating the required prop - I think I could try to fix it myself via PR. What are the next steps if it is the case ?

Thank you

attitude commented 1 year ago

Hi @Thommas2316, thank you for your patience.

Your issues with display of asterisk should now all be resolved in v1.2. I will close this issue, however, feel free to reopen if issues persist.

As a side-note, the required prop on the UI FieldContainer component does not trigger any validations. Its responsibility is only to display the asterisk.

Thanks for the report 🙌

Working example how to display required asterisk next to a label