Skip to content

Accordion: Text in a closed accordion panel cannot be found via the browser search #73443

Closed

Description

@hanneslsm

Description

This issue came up in the WordPress Online Meetup DACH.

Content in a closed accordion panel is cannot be found via the browser search.
It does work in the details block, which opens automatically.

It might make sense to add hidden="until-found" attribute: https://developer.chrome.com/docs/css-ui/hidden-until-found

Step-by-step reproduction instructions

  1. Create an accordion and add text to accordion panel
  2. View the post
  3. Open the browser search with cmd+F
  4. Search for a word that is in the text in the panel

Screenshots, screen recording, code snippet

Editor Image

As you can see, you cannot find the text:
Image


It works in the details block:
Image

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Activity

  1. changed the title [-]Accordion:[/-] [+]Accordion: Text in a closed accordion panel cannot be found via the browser search[/+] on Nov 19, 2025
  2. luminuu commented on Nov 19, 2025

    @luminuu
    Member

    Can confirm this on a local install with 6.9 RC2.

  3. t-hamano commented on Nov 23, 2025

    @t-hamano
    Contributor

    Thanks for the suggestion.

    Unfortunately, hidden="until-found" doesn't seem to be supported in Safari yet: https://caniuse.com/?search=hidden%3Duntil-found

    There may be another technical approach, but it would be a somewhat hacky approach. In any case, we think this is something that needs a bit more research to address in the 6.9 release, so let's punt it to 7.0.

  4. moved this from 📥 Todo to 🦵 Punted to 7.0 in WordPress 6.9 Editor Taskson Nov 23, 2025
  5. added
    [Focus] Accessibility (a11y)Changes that impact accessibility and need corresponding review (e.g. markup changes).
    on Nov 23, 2025
  6. brnhrst commented on Nov 24, 2025

    @brnhrst

    hidden="until-found" is already available in the Safari 26.2 beta:
    https://developer.apple.com/documentation/safari-release-notes/safari-26_2-release-notes#DOM

    Given that Chrome, Firefox, and Edge already support it, and Safari is about to, it may not be necessary to wait for WordPress 7.0 solely because of Safari support.

  7. t-hamano commented on Jan 6, 2026

    @t-hamano
    Contributor

    Since hidden="until-found" should be supported in all major browsers now, it might be worth addressing this issue in 7.0.

  8. harshbhonsle commented on Jan 7, 2026

    @harshbhonsle
    Contributor

    Hi, I’d like to work on this issue. I think the problem is in accordion-panel, where CSS hides the content and breaks browser search. My approach would be to add hidden="until-found" to the panel content — is this the right way to fix it?
    Thanks!

  9. 5 remaining items

  10. ddryo commented on Jan 13, 2026

    @ddryo
    Contributor

    Although the article is in Japanese, there is a post that provides a detailed summary of implementing accordions using hidden="until-found".

    https://css-notes.com/ui/accordion-with-wai-aria

  11. SohamPatel46 commented on Jan 19, 2026

    @SohamPatel46
    Contributor

    Hi, I followed the solution suggested by @t-hamano
    I have opened a PR to fix this - #74744

    I also went through the article referred by @ddryo, and I feel we should also make role="region" attribute dynamic for better accessibility. Here is PR incorporating those changes as well - #74747

  12. hikari-kato commented on Feb 20, 2026

    @hikari-kato

    Hi, I'm a theme developer who encountered a related issue while implementing open/close animations for the Accordion block.
    The current display: none used to hide closed panels also prevents CSS transitions from working. Since you can't animate from display: none, I had to work around it by overriding display: none with CSS and controlling the panel height via JavaScript (scrollHeight → height: 0 with a CSS transition).
    This workaround functions, but it adds extra JavaScript that wouldn't be necessary if the panel visibility were handled differently at the core level.
    If hidden="until-found" is adopted to address the browser search issue, it would likely resolve the animation limitation as well, since theme developers would no longer need to fight against display: none. That would be a great improvement for theme customization.
    Just wanted to share this perspective as additional context for why resolving the underlying display: none approach matters beyond just browser search functionality.

  13. Mamaduka commented on Feb 20, 2026

    @Mamaduka
    Member

    I think we can go with the hidden="until-found" solution and acknowledge the problem with Safari. The fix in Firefox should ship next week - https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/148.

  14. moved this from 📥 Todo to 🔎 Needs Review in WordPress 7.0 Editor Taskson Mar 12, 2026
  15. t-hamano commented on Mar 26, 2026

    @t-hamano
    Contributor

    Since we are now in the 7.0 RC phase, let's postpone this issue to 7.1.

  16. moved this from 🔎 Needs Review to 🦵 Punted to 7.1 in WordPress 7.0 Editor Taskson Mar 26, 2026
  17. moved this to 📋 Iteration/Tracking Issues in WordPress 7.1 Editor Taskson Jun 10, 2026
  18. moved this from 📋 Iteration/Tracking Issues to 🏗️ In Progress in WordPress 7.1 Editor Taskson Jun 10, 2026
  19. moved this from 🏗️ In Progress to ✅ Done in WordPress 7.1 Editor Taskson Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] AccordionAffects the Accordion Block[Focus] Accessibility (a11y)Changes that impact accessibility and need corresponding review (e.g. markup changes).[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions