Opened 7 months ago

Closed 7 months ago

#35375 closed Bug (fixed)

Original line of tabular inline admin is always shown on the left, even in RTL

Reported by: Eyal Cherevatsky Owned by: nobody
Component: contrib.admin Version: 5.0
Severity: Normal Keywords: admin, inline, rtl, accessibility
Cc: Eyal Cherevatsky Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: yes

Description

When using a tabular inline admin model, the "original" line (containing the string representation and, optionally, a view/change link) is always show on the left. This is fine in most cases, expect for cases where the language is RTL (right-to-left).

The following CSS, if put in django/contrib/admin/static/admin/css/rtl.css, should resolve the issue:

.inline-group .tabular td.original p {
    right: 0;
}

Alternatively, instead of having specific styling for RTL, we can use inset-inline-start instead of left, which will work correctly for both LTR and RTL. I believe this should be changed here:
https://github.com/django/django/blob/dd238212082f6547d5b03c5af6ec53368c39568e/django/contrib/admin/static/admin/css/forms.css#L458

Attachments (4)

ltr.png (99.7 KB ) - added by Eyal Cherevatsky 7 months ago.
rtl.png (85.9 KB ) - added by Eyal Cherevatsky 7 months ago.
ltr-dark.png (100.0 KB ) - added by Eyal Cherevatsky 7 months ago.
rtl-dark.png (85.6 KB ) - added by Eyal Cherevatsky 7 months ago.

Download all attachments as: .zip

Change History (8)

by Eyal Cherevatsky, 7 months ago

Attachment: ltr.png added

by Eyal Cherevatsky, 7 months ago

Attachment: rtl.png added

comment:1 by Eyal Cherevatsky, 7 months ago

Has patch: set

by Eyal Cherevatsky, 7 months ago

Attachment: ltr-dark.png added

by Eyal Cherevatsky, 7 months ago

Attachment: rtl-dark.png added

comment:2 by Sarah Boyce, 7 months ago

Keywords: accessibility added
Triage Stage: UnreviewedAccepted

Thank you for the report and the patch!
I think I prefer option 2 but still testing 👍

comment:3 by Sarah Boyce, 7 months ago

Triage Stage: AcceptedReady for checkin

Went for option 1 as the accessibility team is in the process of discussing the use of logical properties, see: https://github.com/django/django/pull/17560

comment:4 by Sarah Boyce <42296566+sarahboyce@…>, 7 months ago

Resolution: fixed
Status: newclosed

In 2bcf555:

Fixed #35375 -- Fixed tabular inline admin original line to be on the right in RTL.

Note: See TracTickets for help on using tickets.
Back to Top