flask-bootstrap
flask-bootstrap copied to clipboard
`description` property isn't rendered for `BooleanField`
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:
Why isn't description
for BooleanField
rendered?
I'm using Flask-Bootstrap4
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?
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>')