Skip to content

Use the Material UI "required" prop #1695

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

Closed
stevenmckinnon opened this issue Feb 16, 2021 · 3 comments · Fixed by #1798
Closed

Use the Material UI "required" prop #1695

stevenmckinnon opened this issue Feb 16, 2021 · 3 comments · Fixed by #1798

Comments

@stevenmckinnon
Copy link

Is your feature request related to a problem? Please describe.
When marking a field as required, it only adds the asterisk to the label text rather than using the required prop in InputLabel, which doesn't add the separate <span /> Material UI renders. Therefore the styling can't be overridden (i.e. style it as red by default).

Describe the solution you'd like
Use InputLabels's required prop

Describe for which setup you like to have the improvement
Framework: React
RendererSet: material

Additional context
https://material-ui.com/api/input-label/#props:~:text=FormControl.-,required

@sdirix
Copy link
Member

sdirix commented Feb 17, 2021

Good idea!

@sdirix sdirix added this to the next milestone Feb 17, 2021
@sdirix
Copy link
Member

sdirix commented Feb 17, 2021

Duplicate of #1390

It's not really a duplicate. The other issue specifically mentions optional required properties based on if/then/else which is much harder than a general support of Material Ui's required prop. Actually these issues are orthogonal.

@sdirix sdirix marked this as a duplicate of #1390 Feb 17, 2021
@sdirix sdirix closed this as completed Feb 17, 2021
@sdirix sdirix reopened this Feb 17, 2021
@sdirix sdirix removed the duplicate label Feb 17, 2021
LukasBoll added a commit to LukasBoll/jsonforms that referenced this issue Aug 16, 2021
LukasBoll added a commit to LukasBoll/jsonforms that referenced this issue Aug 16, 2021
LukasBoll added a commit to LukasBoll/jsonforms that referenced this issue Sep 9, 2021
LukasBoll added a commit to LukasBoll/jsonforms that referenced this issue Sep 12, 2021
LukasBoll added a commit to LukasBoll/jsonforms that referenced this issue Sep 13, 2021
sdirix pushed a commit that referenced this issue Sep 13, 2021
Material UI supports handing over a 'required' prop to their components.
We now use this prop instead of appending an asterisk manually to  the
control labels in the React Material renderer set . Using this approach the
asterisk is rendered in a consistent and themeable way.

Closes #1695

Signed-off-by: Lukas Boll <[email protected]>
@sdirix sdirix modified the milestones: next, 3.0 Sep 13, 2021
@sdirix
Copy link
Member

sdirix commented Sep 13, 2021

This is now implemented and will be part of the next (alpha) release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants