mirror of
https://github.com/django/django.git
synced 2025-12-23 09:19:27 +00:00
Fixed #36807 -- Fixed form field alignment under <fieldset> in the admin.
Some checks failed
Linters / flake8 (push) Has been cancelled
Linters / isort (push) Has been cancelled
Linters / black (push) Has been cancelled
Linters / zizmor (push) Has been cancelled
Tests / Windows, SQLite, Python 3.14 (push) Has been cancelled
Tests / JavaScript tests (push) Has been cancelled
Docs / spelling (push) Has been cancelled
Docs / blacken-docs (push) Has been cancelled
Docs / lint-docs (push) Has been cancelled
Some checks failed
Linters / flake8 (push) Has been cancelled
Linters / isort (push) Has been cancelled
Linters / black (push) Has been cancelled
Linters / zizmor (push) Has been cancelled
Tests / Windows, SQLite, Python 3.14 (push) Has been cancelled
Tests / JavaScript tests (push) Has been cancelled
Docs / spelling (push) Has been cancelled
Docs / blacken-docs (push) Has been cancelled
Docs / lint-docs (push) Has been cancelled
It isn't safe to set display: flex on <fieldset>, because on Safari this
interferes with display: block on child divs.
Thanks Paulo Coutinho for the report and Antoliny for the review.
Regression in 4187da258f.
This commit is contained in:
parent
968f3f9637
commit
1eac2659a1
6 changed files with 12 additions and 10 deletions
|
|
@ -102,7 +102,7 @@ fieldset .inline-heading,
|
|||
}
|
||||
|
||||
.aligned legend {
|
||||
float: left;
|
||||
float: inline-start;
|
||||
}
|
||||
|
||||
.aligned legend,
|
||||
|
|
@ -148,15 +148,11 @@ form .aligned ul {
|
|||
}
|
||||
|
||||
form .aligned div.radiolist {
|
||||
display: inline-block;
|
||||
display: block;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
form .aligned fieldset div.help {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
form .aligned p.help,
|
||||
form .aligned div.help {
|
||||
margin-top: 0;
|
||||
|
|
|
|||
|
|
@ -560,6 +560,10 @@ input[type="submit"], button {
|
|||
margin-top: 5px;
|
||||
}
|
||||
|
||||
form .aligned fieldset div.flex-container {
|
||||
display: unset;
|
||||
}
|
||||
|
||||
/* Related widget */
|
||||
|
||||
.related-widget-wrapper {
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
<div class="form-row">
|
||||
{{ form.usable_password.errors }}
|
||||
<fieldset class="flex-container">{{ form.usable_password.legend_tag }} {{ form.usable_password }}</fieldset>
|
||||
<fieldset>{{ form.usable_password.legend_tag }} {{ form.usable_password }}</fieldset>
|
||||
{% if form.usable_password.help_text %}
|
||||
<div class="help"{% if form.usable_password.id_for_label %} id="{{ form.usable_password.id_for_label }}_helptext"{% endif %}>
|
||||
<p>{{ form.usable_password.help_text|safe }}</p>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<div class="form-row{% if line.fields|length == 1 and line.errors %} errors{% endif %}{% if not line.has_visible_field %} hidden{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
|
||||
{% if line.fields|length == 1 %}{{ line.errors }}{% else %}<div class="flex-container form-multiline">{% endif %}
|
||||
{% for field in line %}
|
||||
{% if field.is_fieldset %}<fieldset class="flex-container"{% if field.field.help_text %} aria-describedby="{{ field.field.id_for_label }}_helptext"{% endif %}>{{ field.label_tag }}{% endif %}
|
||||
{% if field.is_fieldset %}<fieldset{% if field.field.help_text %} aria-describedby="{{ field.field.id_for_label }}_helptext"{% endif %}>{{ field.label_tag }}{% endif %}
|
||||
<div>
|
||||
{% if not line.fields|length == 1 and not field.is_readonly %}{{ field.errors }}{% endif %}
|
||||
<div class="flex-container{% if not line.fields|length == 1 %} fieldBox{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.field.is_hidden %} hidden{% endif %}{% endif %}{% if field.is_checkbox %} checkbox-row{% endif %}">
|
||||
|
|
|
|||
|
|
@ -24,3 +24,6 @@ Bugfixes
|
|||
* Fixed a regression in Django 6.0 that caused
|
||||
:meth:`~django.db.models.query.QuerySet.bulk_create` to crash
|
||||
when introspecting the connection on SQLite (:ticket:`36818`).
|
||||
|
||||
* Fixed a visual regression in Django 6.0 for admin form fields grouped under a
|
||||
``<fieldset>`` in Safari (:ticket:`36807`).
|
||||
|
|
|
|||
|
|
@ -1555,8 +1555,7 @@ class ChangelistTests(MessagesTestMixin, AuthViewsTestCase):
|
|||
# Usable password field.
|
||||
self.assertContains(
|
||||
response,
|
||||
'<fieldset class="flex-container">'
|
||||
"<legend>Password-based authentication:</legend>",
|
||||
"<fieldset><legend>Password-based authentication:</legend>",
|
||||
)
|
||||
# Submit buttons
|
||||
self.assertContains(response, '<input type="submit" name="set-password"')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue