mirror of
https://github.com/django/django.git
synced 2025-09-10 11:09:12 +00:00
Fixed #36556 -- Fixed TabularInline width overflowing the page.
This commit is contained in:
parent
9efce80ca7
commit
3e7aedfb2e
@ -432,9 +432,12 @@ body.popup .submit-row {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.inline-related.tabular div.wrapper {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.inline-related.tabular fieldset.module table {
|
||||
width: 100%;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
|
||||
.last-related fieldset {
|
||||
|
@ -15,6 +15,7 @@
|
||||
</h2>
|
||||
{% if inline_admin_formset.is_collapsible %}</summary>{% endif %}
|
||||
{{ inline_admin_formset.formset.non_form_errors }}
|
||||
<div class="wrapper">
|
||||
<table>
|
||||
<thead><tr>
|
||||
<th class="original"></th>
|
||||
@ -63,6 +64,7 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% if inline_admin_formset.is_collapsible %}</details>{% endif %}
|
||||
</fieldset>
|
||||
</div>
|
||||
|
@ -2501,6 +2501,16 @@ class SeleniumTests(AdminSeleniumTestCase):
|
||||
tabular_inline.find_elements(By.CSS_SELECTOR, ".collapse"),
|
||||
[],
|
||||
)
|
||||
# The table does not overflow the content section.
|
||||
content = self.selenium.find_element(By.ID, "content-main")
|
||||
tabular_wrapper = self.selenium.find_element(
|
||||
By.CSS_SELECTOR, "div.tabular.inline-related div.wrapper"
|
||||
)
|
||||
self.assertGreater(
|
||||
tabular_wrapper.find_element(By.TAG_NAME, "table").size["width"],
|
||||
tabular_wrapper.size["width"],
|
||||
)
|
||||
self.assertLessEqual(tabular_wrapper.size["width"], content.size["width"])
|
||||
|
||||
@screenshot_cases(["desktop_size", "mobile_size", "rtl", "dark", "high_contrast"])
|
||||
def test_tabular_inline_delete_layout(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user