#35456: Fieldset title inside a collapsed StackedInline are `h3` but on errors 
are
shown as `h2`
-------------------------------------+-------------------------------------
     Reporter:  Natalia Bidart       |                    Owner:  nobody
         Type:                       |                   Status:  closed
  Cleanup/optimization               |
    Component:  contrib.admin        |                  Version:  5.0
     Severity:  Normal               |               Resolution:  duplicate
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  1
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

 * resolution:   => duplicate
 * status:  new => closed
 * summary:
     Fieldset title inside StackedInline are `h3` but on errors are shown
     as `h2`
     =>
     Fieldset title inside a collapsed StackedInline are `h3` but on errors
     are shown as `h2`

Comment:

 Thank you for the models, admin and screenshots!

 I think the core issue here you are reporting is that the heading tag
 should not change between the collapse and expand state. When there is an
 error, this is in the expanded state but this header tag switching
 behaviour also happens when clicking on show and hide.

 What the header tags should be is also interesting. This article helped me
 understand: https://developer.mozilla.org/en-
 US/docs/Web/HTML/Element/Heading_Elements
 Here are some rules:
 - Have only 1 <h1> (this is "Add book")
 - Don't skip headers
 - Use headers to show subsections

 I think these are the issues:
 - the first collapsed inline "Advanced options" is h2 when collapsed but
 h3 when expanded. It should always be h2 otherwise we skip a header level
 - the next collapsed inline "History" is h2 when collapsed but h3 when
 expanded. In this case it is subsection of `Review: #1` which is a h3 (1.
 Add book > 2. Reviews > 3. `Review #1`) and so as a subsection of a h3, it
 should be a h4 in both collapsed and expanded.

 Then basically there are 2 bugs:
 - the header shouldn't change between the collapse and expanded state
 (this issue is covered by #35189)
 - inline headers do not respect the page hierarchy (this is independent of
 the collapse and expand feature, it is "touched" upon in #35189 and will
 likely be fixed in #35189 - we can pull this out to a separate issue if we
 wish)

 I am going to mark this as a duplicate of #35189 as what you have reported
 I believe is covered and will be fixed there 👍
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35456#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018f803f6e78-393757d3-a438-4ad5-be07-450edd6bb8a6-000000%40eu-central-1.amazonses.com.

Reply via email to