Opened 7 weeks ago

Last modified 2 weeks ago

#36192 assigned Cleanup/optimization

Use semantic HTML for buttons in Django Admin

Reported by: Eliana Rosselli Owned by: Philip Narteh
Component: contrib.admin Version: 5.1
Severity: Normal Keywords: accessibility
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description (last modified by Eliana Rosselli)

Right now the Django Admin has some buttons that are actually link tags with role="button" set, i.e

<a role="button">

We also have anchor elements with

<a href="#" >

that are also acting as buttons. One example is the "Today" button that can be found next to date and time inputs.

We should change these to be proper HTML buttons , and update their CSS so they maintain their existing styling. Below is an example of this kind of button; in the image, the "Add another Release" button is using an anchor element

Example of a button that uses an anchor tag: "Add another Release"

According to the ticket's flags, the next step(s) to move this issue forward are:

  • To improve the patch as described in the pull request review comments or on this ticket, then uncheck "Patch needs improvement".
  • If creating a new pull request, include a link to the pull request in the ticket comment when making that update. The usual format is: [https://github.com/django/django/pull/#### PR].

Change History (7)

by Eliana Rosselli, 7 weeks ago

Attachment: examplebutton.png added

Example of a button that uses an anchor tag: "Add another Release"

comment:1 by Eliana Rosselli, 7 weeks ago

Description: modified (diff)

comment:2 by Sarah Boyce, 6 weeks ago

Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization

This is a follow on from #35795

comment:3 by Eliana Rosselli, 6 weeks ago

Description: modified (diff)

comment:4 by Philip Narteh, 5 weeks ago

Owner: changed from Eliana Rosselli to Philip Narteh

comment:5 by Philip Narteh, 2 weeks ago

Has patch: set

comment:6 by Sarah Boyce, 2 weeks ago

Patch needs improvement: set
Note: See TracTickets for help on using tickets.
Back to Top