-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Don't reserve space for label when there is no label #18850
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
Labels
Comments
I think both case should be handled. For me, with the following collection type: public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('domain', null, [
'label' => 'ssl_certificate.form.domain',
'translation_domain' => 'front',
])
->add('subdomains', CollectionType::class, [
'label' => 'ssl_certificate.form.subdomains',
'translation_domain' => 'front',
'type' => TextType::class,
'allow_add' => true,
'allow_delete' => true,
'prototype' => true,
'options' => [
'label' => false,
'text_suffix' => '',
'attr' => [
'class' => 'subdomain-domain',
],
],
])
;
} I get this: This is useless and related to @flip111 link. But I also agree that in some case this "no content" space can be useful to keep form alignement. Example: ->add('test', TextType::class, [
'mapped' => false,
'label' => false,
'attr' => [
'placeholder' => 'My label goes here',
]
]) But in any case, this should not be handled like this IMHO but with a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In this code a div is taking up space with no contents. I understand that if there are siblings with a label you want to align them. But often you have either no labels at all or everything has a label. Some logic could be introduced here to look at siblings.
The text was updated successfully, but these errors were encountered: