-
-
Notifications
You must be signed in to change notification settings - Fork 92
Make sure that field errors are always visible #767
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
Conversation
Bootstrap sets `display: none` unless the error comes after an invalid field. Fixes zostera#763 and potentially zostera#749
Pull Request Test Coverage Report for Build 18627842736Details
💛 - Coveralls |
|
This would be the correct HTML: {% if field_errors %}
<div id="{{ field.auto_id }}_error" class="invalid-feedback">
{% for text in field_errors %}
<div>{{ text }}</div>
{% endfor %}
</div>
{% endif %}As Bootstrap targets the directly followed element of .is-invalid~.invalid-feedback, .is-invalid~.invalid-tooltip, .was-validated :invalid~.invalid-feedback, .was-validated :invalid~.invalid-tooltip {
display: block;
}
No need to "manually" add the display or width classes. Credit goes to @christianwgd in #763 (comment) |
|
That would not fix #749, would it? |
|
It should, since it's the same markup required and as long as the template is injected at the right place. |
|
If it has worked before, then it should work now. |
## [3.12.0] - 2025-09-05 ### Added - Workaround for `structuretimers` form template to use Bootstrap5 form until fixed and release upstream (https://gitlab.com/ErikKalkoken/aa-structuretimers/-/merge_requests/22) - Workaround for `django-bootstrap5` error template until it is fixed and released upstream (zostera/django-bootstrap5#767) - Bottom margin to DataTable filter wrappers - Bootstrap tooltips to `package_monitor` templates - Transition animation to overflow changes - Overflow detection and monitoring - Border radius to active menu items ### Fixed - HighlightJS copy code button size and position - Some transparencies
|
You just merged the wrong markup. Also, the extra classes ( |
|
Should we revert #767? |
And replace with the proper markup - #767 (comment) {% if field_errors %}
<div id="{{ field.auto_id }}_error" class="invalid-feedback">
{% for text in field_errors %}
<div>{{ text }}</div>
{% endfor %}
</div>
{% endif %} |



Fixes #763 and potentially #749
I also fixed the
.input-grouprelated issue I mentioned in #763 (comment).I implemented this as an alternative to #766 because I thought that just overwriting bootstrap's
display: noneis more robust than adding dummy elements.