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

description property isn't rendered for BooleanField #197

Open
shnela opened this issue Oct 22, 2019 · 2 comments
Open

description property isn't rendered for BooleanField #197

shnela opened this issue Oct 22, 2019 · 2 comments

Comments

@shnela
Copy link

shnela commented Oct 22, 2019

I have following form definition:

class Form(FlaskForm):
    text = StringField(description='Some visible text')
    unique = BooleanField(description="Won't be rendered")

And below I'm presenting how does html rendered by following template loooks like:

{% for field in form %}
    {{ wtf.form_field(field) }}
{% endfor %}
<div class="form-group "><label class="form-control-label" for="text">Text</label>
        <input class="form-control" id="text" name="text" type="text" value="">
        <small class="form-text text-muted">Some visible text</small>
</div>
<div class="form-check">
      <label class="form-check-label">
      <input class="form-check-input" id="unique" name="unique" type="checkbox" value="y">
Unique
     </label>
</div>

Here's how it looks like live:
image

Why isn't description for BooleanField rendered?

I'm using Flask-Bootstrap4

@shnela
Copy link
Author

shnela commented Feb 5, 2020

It looks like checkbox field is rendered separately here, but descriptor field is rendered for other field types only here.

Would be someone interested in merging pull request if I've fixed that?

@shnela
Copy link
Author

shnela commented Feb 5, 2020

And workaround if someone needed:

class Form(FlaskForm):
    text = StringField(description='Some visible text')
    unique = BooleanField(label='Unique - <small>Bow this "description" is visible</small>')

greyli added a commit to helloflask/bootstrap-flask that referenced this issue Apr 21, 2020
smartdev0712 pushed a commit to smartdev0712/jinja-bootstrap-flask that referenced this issue Apr 21, 2022
VV-YY added a commit to VV-YY/bootstrap_flask that referenced this issue Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant