Skip to content
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

inline style does not display placeholder when label empty #350

Closed
GdotBdot opened this issue Jan 22, 2015 · 0 comments
Closed

inline style does not display placeholder when label empty #350

GdotBdot opened this issue Jan 22, 2015 · 0 comments
Labels
Milestone

Comments

@GdotBdot
Copy link

When a label is empty, but not explicitly set false, the name is used instead for regular labels. However, when using the inline style, the name is not shown as placeholder. I think this is inconsistent.
The reason can be found in the fields definition (BraincraftedBootstrapBundle:Form:bootstrap.html.twig), line 39 (block form_widget_simple):

{% if style == 'inline' and (attr.placeholder is not defined or attr.placeholder is empty)  and label != false %}
  {% if label is empty %}
    {% set attr = attr|merge({ 'placeholder': name|humanize }) %}
  {% else %}
    {% set attr = attr|merge({ 'placeholder': label}) %}
  {% endif %}
{% endif %}

The label != false comparision is not true if label is empty (thus, the next line does not make sense). I think it would be correct to do it as in line 562 (block form_label):

{% if label is not sameas(false) %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants