Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#17518 closed Bug (fixed)

Display of StackedInline has glitch with Firefox/Iceweasel (Gecko)

Reported by: Sebastian Goll Owned by: nobody
Component: contrib.admin Version: dev
Severity: Normal Keywords: comsetic, admin, stacked inline, glitch
Cc: sebastian.goll@… 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

Current trunk has the following cosmetic problem with StackedInline in the admin. Stacked fieldsets listed with a "Delete" checkbox don't get the full width of the form table on Firefox/Iceweasel (Gecko engine). The glitch happens at least with versions 8.0 and 9.0.1. It does not happen with Chromium 15.0 or Opera 11.60. The problem seems to be that the Gecko engine somehow decides to subtract the width of the "Delete" checkbox from the width of the fieldset below.

I'm attaching two screenshots to illustrate the problem. I'm also attaching a simple patch that fixes the issue, and which has no undesired side-effects on the two other browsers that I could test.

Attachments (5)

before.png (145.1 KB ) - added by Sebastian Goll 12 years ago.
r17364-admin-inline-css.diff (398 bytes ) - added by Sebastian Goll 12 years ago.
after.png (145.7 KB ) - added by Sebastian Goll 12 years ago.
17518-firefox-working.png (84.3 KB ) - added by Julien Phalip 12 years ago.
17518-firefox-linux-not-working.png (42.4 KB ) - added by Sebastian Goll 12 years ago.

Download all attachments as: .zip

Change History (18)

by Sebastian Goll, 12 years ago

Attachment: before.png added

by Sebastian Goll, 12 years ago

by Sebastian Goll, 12 years ago

Attachment: after.png added

comment:1 by Sebastian Goll, 12 years ago

PS: The glitch described here is not related to the inlining of thumbnails shown in the screenshots. It also happens with a vanilla project that contains nothing but a parent model and a related model inlined in the parent's admin page:

# models.py

class A(models.Model):
    pass

class B(models.Model):
    a = models.ForeignKey(A)
    b = models.CharField(max_length=200)

# admin.py

class BInline(admin.StackedInline):
    model = B

class AAdmin(admin.ModelAdmin):
    inlines = (BInline,)

admin.site.register(A, AAdmin)

comment:2 by Sebastian Goll, 12 years ago

Cc: sebastian.goll@… added

comment:3 by Jannis Leidel, 12 years ago

Triage Stage: UnreviewedReady for checkin

comment:4 by Julien Phalip, 12 years ago

I can't seem to reproduce this error using Firefox 10.0.2. Could someone else confirm?

comment:5 by Sebastian Goll, 12 years ago

I just upgraded my local install of Firefox/Iceweasel to 10.0.2, and I'm still experiencing the same error. Note that it's the line between two different fields of the stacked inline model, not the line between "delete" and the first field, that's shorter than the row. (My simplified example above was misleading insofar as it requires an additional field c in B to properly reproduce the error as shown in the screenshots. I apologize.)

# models.py

class A(models.Model):
    pass

class B(models.Model):
    a = models.ForeignKey(A)
    b = models.CharField(max_length=200)
    c = models.CharField(max_length=200)

# admin.py

class BInline(admin.StackedInline):
    model = B

class AAdmin(admin.ModelAdmin):
    inlines = (BInline,)

admin.site.register(A, AAdmin)

I'm also using current trunk (r17547, 1.4b1).

comment:6 by Julien Phalip, 12 years ago

Thanks for the updated code sample. However, I still can't reproduce the problem. See the attached screenshot. Am I missing something?

by Julien Phalip, 12 years ago

Attachment: 17518-firefox-working.png added

comment:7 by Julien Phalip, 12 years ago

Which OS are you using? I'm on Mac OSX.

comment:8 by Sebastian Goll, 12 years ago

Wow, that is strange. I'm running Linux (Debian wheezy/sid, Linux 3.2.0-1-amd64, X.Org 1.11.3.901). See the attached screenshot of the same admin view as yours, with the broken horizontal lines.

How do we proceed here? Is it an OS bug, an Xorg bug, a bug with Firefox/Iceweasel, a bug with the Gecko engine …? It is only a minor issue after all, so if we decide to not apply the proposed patch but rather blame the browser/OS combination, that'd be perfectly fine with me.

Has the proposed patch (one-liner) any unintended consequences? I.e. would it hurt to include it "just in case"?

by Sebastian Goll, 12 years ago

comment:9 by Claude Paroz, 12 years ago

Cannot reproduce the problem either: !Debian squeeze Iceweasel 9.0.1

comment:10 by Julien Phalip, 12 years ago

I wonder what's causing that issue. Weird :)

The patch makes sense but it'd be useful to test on other browsers, in particular IE7+ which sometimes treat 'width:100%' in a different way.

comment:11 by Aymeric Augustin, 12 years ago

Resolution: fixed
Status: newclosed

Fixed #17518 -- CSS glitch in StackedInline.

Thanks sebastian for the report and patch.

Changeset: 3dde02640c1bec4a2b34d12e6f92aa0a7f035227

comment:12 by Aymeric Augustin, 12 years ago

Fixed #17518 -- CSS glitch in StackedInline.

Thanks sebastian for the report and patch.

Changeset: 3dde02640c1bec4a2b34d12e6f92aa0a7f035227

comment:13 by Aymeric Augustin, 12 years ago

Fixed #17518 -- CSS glitch in StackedInline.

Thanks sebastian for the report and patch.

Changeset: 3dde02640c1bec4a2b34d12e6f92aa0a7f035227

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