Display description for boolean/checkbox (MUI)

Hi all, I’m using the Material/React renderers and from what I can see, the boolean controls do not display their ‘description’. Am I wrong about this? If not, could anyone point me towards the code that might need to be changed to add this feature.

Hi @brockfanning,

Yes that’s true. Our checkbox renderer does not render the description. To achieve this you need to add a custom renderer which prints the description in some way. I would recommend copying the original implementation and adjusting it to your needs.

Thanks very much @sdirix. Once I get the custom renderer working do you have any interest in a pull-request to add the feature to jsonforms? Or do you prefer to leave things as-is?

Hi @brockfanning,

In general we’re happy to retrieve quality contributions! So if you manage to find a way to nicely include the description then this would certainly be interesting. If you want to make sure that we are willing to accept the contribution then please post your suggestion here or as a new issue on the JSON Forms repository containing the concrete proposal.

The problem here is consistency with the other controls. By default all controls only show the description once they gain focus. However a boolean checkbox/toggle does not have such a focus state and will therefore necessarily differ. Maybe we could include it as a tooltip (i.e. title)?

Thanks @sdirix - your idea of a tooltip sounded good to me and so I’ve tried that in a PR: Show description or tooltip on boolean controls by brockfanning · Pull Request #2072 · eclipsesource/jsonforms · GitHub

1 Like