Skip to content

Accordion - consider hidden="until-found" to allow the in-page search to find accordion content #235

@msayoung

Description

@msayoung

If we were to use the hidden attribute to show / hide the accordion panes, we could make use of the hidden="until-found" attribute which allows CTRL F to find content within a closed accordion.

Which I think is pretty cool.

https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/hidden


Also, while I'm looking, @markconroy do you know why we have a hidden span in the accordion pane heading?
It seems unneeed, but maybe there's a reason.

<div class="accordion-pane__title">
        <h3>
          **<span class="accordion-pane__heading" hidden="">Accordion title</span>**
          <button aria-expanded="false" aria-controls="accordion-content-0-0">
            Accordion title
            <span class="accordion-icon" aria-hidden="true"></span>
          </button>
        </h3>
      </div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions