How to support "Find on Page" with hidden text

Viewed 32

I have some webpages with a lot of content, and a feature that can organize them into blocks that can be opened and closed (to make it easier to see the structure etc.). However, the content that is currently hidden can't be searched on the page anymore (using "Find" or "Find on Page" of the user's browser).

I've tried regular divs with display:none, I've tried the <details> block, etc. Browsers seem to consistently avoid searching hidden content.

Ideally, as soon as the browser's "Find" dialog pops up, it would search (and display!) hidden content as it found it. Or, I could trigger on some internal event and just open all closed <details> blocks when the user started searching.

Are there better approaches to support opening/closing content blocks, but still allow full-page search by the user?

0 Answers
Related