Opened 8 months ago

Closed 7 months ago

Last modified 7 months 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 8 months ago.

Download all attachments as: .zip

Change History (13)

by Antoliny, 8 months ago

comment:1 by Antoliny, 8 months ago

Owner: set to Antoliny
Status: newassigned

comment:2 by Antoliny, 8 months 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, 8 months ago

Has patch: set

comment:5 by Natalia Bidart, 8 months ago

Triage Stage: UnreviewedAccepted

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

comment:6 by Natalia Bidart, 8 months 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, 8 months ago

Needs tests: unset

comment:8 by Sarah Boyce, 7 months ago

Needs tests: set

comment:9 by Antoliny, 7 months ago

Needs tests: unset

comment:10 by Sarah Boyce, 7 months ago

Triage Stage: AcceptedReady for checkin

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

Resolution: fixed
Status: assignedclosed

In 1330cb5:

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

comment:12 by Sarah Boyce <42296566+sarahboyce@…>, 7 months 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