Skip to content
This repository has been archived by the owner on Dec 11, 2021. It is now read-only.

Add labelClass option to block definition and closedOnAdd option #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add labelClass option to block definition and closedOnAdd option #13

wants to merge 2 commits into from

Conversation

joeyjurjens
Copy link

@joeyjurjens joeyjurjens commented Oct 31, 2020

I've added this option because I've blocks where I don't need to show the label, if we add an optional labelClass option we can easily hide/style them. Same goes for some nested blocks, why show them all instantly. I think an option for that would be very useful too!

Hope you guys think those are good options too! :)

@joeyjurjens joeyjurjens changed the title Add labelClass option to block definition Add labelClass option to block definition and closedOnAdd option Nov 2, 2020
!!blockDefinition.required && 'required')}>
<label className='field__label' htmlFor={getFieldName(blockId)}>
!!blockDefinition.required && 'required', )}>
<label className={classNames('field__label', blockDefinition.labelClass)} htmlFor={getFieldName(blockId)}>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is for react-streamfield team: If there is some way to get className on the div, that would probably also work (higher level in the dom tree is usually more "future-proof"). Or is there already a recommended way to accomplish customizing the HTML output?

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

Successfully merging this pull request may close these issues.

2 participants