Opened 5 weeks ago

Closed 9 days ago

Last modified 9 days ago

#36069 closed Bug (fixed)

The position of the "X" button for the InlineForm in TabularInline differs depending on the can_delete value.

Reported by: Antoliny Owned by: Antoliny
Component: contrib.admin Version: dev
Severity: Normal Keywords: TabularInline
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

class CommentInline(admin.TabularInline):
    model = Comment
    extra = 1
    can_delete = False

class TagInline(admin.TabularInline):
    model = Tag
    extra = 1


class PostAdmin(admin.ModelAdmin):
    inlines = [CommentInline, TagInline]

When can_delete is set to False in TabularInline, remove button of the InlineForm moves to the bottom (it should be at the top originally).

Attachments (1)

tabular_inline_delete_button.png (39.7 KB ) - added by Antoliny 5 weeks ago.

Download all attachments as: .zip

Change History (13)

by Antoliny, 5 weeks ago

comment:1 by Antoliny, 5 weeks ago

Owner: set to Antoliny
Status: newassigned

comment:2 by Antoliny, 5 weeks ago

Summary: When can_delete is set to False in TabularInline, the position of the remove (X) button for the InlineForm is different.The position of the "X" button for the InlineForm in TabularInline differs depending on the can_delete value.

comment:3 by Antoliny, 5 weeks ago

Has patch: set

comment:4 by Antoliny, 5 weeks ago

comment:5 by Natalia Bidart, 5 weeks ago

Triage Stage: UnreviewedAccepted

Thank you Antoliny! I reproduced in latest main, accepting.

comment:6 by Natalia Bidart, 5 weeks ago

Needs tests: set

Code-wise the PR looks good, I asked for a minimal test to ensure no regressions occur in the template.

comment:7 by Antoliny, 5 weeks ago

Needs tests: unset

comment:8 by Sarah Boyce, 2 weeks ago

Needs tests: set

comment:9 by Antoliny, 13 days ago

Needs tests: unset

comment:10 by Sarah Boyce, 10 days ago

Triage Stage: AcceptedReady for checkin

comment:11 by Sarah Boyce <42296566+sarahboyce@…>, 9 days ago

Resolution: fixed
Status: assignedclosed

In 1330cb5:

Fixed #36069 -- Fixed the delete button position in TabularInlines.

comment:12 by Sarah Boyce <42296566+sarahboyce@…>, 9 days ago

In 209d0f61:

[5.2.x] Fixed #36069 -- Fixed the delete button position in TabularInlines.

Backport of 1330cb570519170bb4397b4fb02c7e3e0657855a from main.

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