Opened 2 months ago
Last modified 3 weeks ago
#36554 assigned Bug
When the object __str__ is long, the object title is truncated in TabularInline.
| Reported by: | Antoliny | Owned by: | Antoliny |
|---|---|---|---|
| Component: | contrib.admin | Version: | 5.2 |
| Severity: | Normal | Keywords: | inline |
| Cc: | Antoliny | Triage Stage: | Accepted |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | yes |
| Easy pickings: | no | UI/UX: | yes |
Description (last modified by )
In TabularInline, there is an issue where the text gets cut off when the object's __str__ is long.
The above image is fine because the screen is wide, but on a mobile screen, the text gets cut off as shown below.
Recently, the font size of TabularInline was made the same as StackedInline https://github.com/django/django/commit/65377325855ab6faa7ac487e336e9902c6268c96, resulting in a larger font than before.
As a result, the likelihood of this issue occurring has increased, and as seen in the above image, links rendered via show_change_link are also cut off, preventing the use of the features provided by default.
Attachments (2)
Change History (21)
by , 2 months ago
| Attachment: | Screenshot 2025-08-15 at 11.58.32 AM.png added |
|---|
comment:1 by , 2 months ago
| Component: | contrib.admindocs → contrib.admin |
|---|
comment:2 by , 2 months ago
| Description: | modified (diff) |
|---|
by , 2 months ago
| Attachment: | tabular_object_str.png added |
|---|
comment:3 by , 2 months ago
| Description: | modified (diff) |
|---|
comment:4 by , 2 months ago
| Summary: | In TabularInline, the text is truncated when the object's __str__ is too long. → When the object __str__ is long, the text is truncated in TabularInline. |
|---|
follow-up: 7 comment:5 by , 2 months ago
| Summary: | When the object __str__ is long, the text is truncated in TabularInline. → When the object __str__ is long, the object title is truncated in TabularInline. |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:6 by , 2 months ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:7 by , 2 months ago
Replying to Sarah Boyce:
I think the title can have a "..." when truncating so that folks know that the title has been truncated and the change button should always be available
If we could solve the problem in the most ideal way, it would be to show the entire title text, right?
I’m concerned that using truncation, especially with mobile sizes in mind, might result in showing too little of the title.
follow-up: 9 comment:8 by , 2 months ago
I suppose it should be consistent with other titles, such as for StackedInline
comment:9 by , 2 months ago
Replying to Sarah Boyce:
I suppose it should be consistent with other titles, such as for StackedInline
This is a post I wrote on the forum a while ago. If you have some time, could you take a look at it?
How about solving it using this approach?
If we adopt this approach, I think we would only need to adjust the position of the View On Site link.
comment:11 by , 8 weeks ago
| Patch needs improvement: | set |
|---|
comment:12 by , 8 weeks ago
| Patch needs improvement: | unset |
|---|
comment:13 by , 5 weeks ago
| Patch needs improvement: | set |
|---|
comment:14 by , 4 weeks ago
| Patch needs improvement: | unset |
|---|
comment:15 by , 4 weeks ago
| Needs tests: | set |
|---|
comment:16 by , 4 weeks ago
| Needs tests: | unset |
|---|
comment:17 by , 4 weeks ago
| Patch needs improvement: | set |
|---|
comment:18 by , 3 weeks ago
| Patch needs improvement: | unset |
|---|
comment:19 by , 3 weeks ago
| Patch needs improvement: | set |
|---|


I think the title can have a "..." when truncating so that folks know that the title has been truncated and the change button should always be available