-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Don't render hidden widgets in markdown visual editor #1414
Don't render hidden widgets in markdown visual editor #1414
Conversation
Fixes decaporg#1405 Fields using hidden was rendered in the markdown editor with "no control" error if no label attached, else a grey box. Return null when rendering the control for hidden widgets.
Deploy preview for cms-demo ready! Built with commit 2e270c6 |
Deploy preview for netlify-cms-www ready! Built with commit 2e270c6 |
Hey! To throw in my salt; another approach could be to construct a boolean holding if this widget is hidden or not.
then on the div upon return; |
@fellasuess It makes sense and i thought about this as well, then i found the following code for other hidden widgets: Maybe the preferred way is to not execute the rest of the code (by the early return of null) if the component has no value of being rendered. Anyone else has an opinion on this? |
Rendering null is 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Fixes #1405
- Summary
Fields using hidden was rendered in the markdown editor with "no control" error if no label attached, else a grey box. Return null when rendering the control for hidden widgets.
- Test plan
After change UI no longer displays hidden components in the markdown visual editor, nor the markdown editor.
This was tested using the registered widget in the bug report, attached below.
- Description for the changelog
Return null when rendering hidden widgets in the markdown editor.
- A picture of a cute animal (not mandatory but encouraged)