Opened 7 years ago

Closed 7 years ago

#9074 closed (fixed)

The submit line on a change form in the admin site is not rendered correctly if it only contains the Save button

Reported by: varikin Owned by: nobody
Component: Contrib apps Version: master
Severity: Keywords: newforms-admin
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I have a custom template/view/form in the admin site which only has the save button in the submit row. The gray box that should contain all the buttons is collapses with the Save button rendered over/below the gray box. See the attached image for a screenshot. I am also attaching my template, view, and form to ease reproducing.

The issue seems to stem from "float: right" set to the button with "input[type=submit].default" in admin/media/globals.css. Removing the "float: right" though makes the save button appear as the left most button with multiple buttons on the submit row and the delete button is messed up. To fix that, I also updated the submit_line.html template to have the Save button last in the list.

Attachments (4)

save button.png (48.2 KB) - added by varikin 7 years ago.
Screenshot of issue
views.py (622 bytes) - added by varikin 7 years ago.
example views.py to reproduce
upload_zip_file.html (621 bytes) - added by varikin 7 years ago.
example template to reproduce issue
admin.diff (2.3 KB) - added by varikin 7 years ago.
proposed patch

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by varikin

Screenshot of issue

Changed 7 years ago by varikin

example views.py to reproduce

Changed 7 years ago by varikin

example template to reproduce issue

Changed 7 years ago by varikin

proposed patch

comment:1 Changed 7 years ago by varikin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I found that the popups only have a save button that is rendered correctly. This is because the submit-row div has "overflow: auto;" set for the style in the html. Doing the same in my template solves my issue, but I am wondering if that should then be added to the globals.css instead of set in the html.

comment:2 Changed 7 years ago by wilson

  • Resolution set to fixed
  • Status changed from new to closed

(In [9039]) Fixed #9074: Added overflow: hidden to the submit-row div to clear the floated contents and avoid collapsing when the Save button is all that's there.

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