CDCgov / phdi

https://cdcgov.github.io/dibbs-site/
Creative Commons Zero v1.0 Universal
34 stars 14 forks source link

SPIKE: Searching within eCR Viewer (Labs) #2600

Open emmastephenson opened 1 month ago

emmastephenson commented 1 month ago

What needs to be done

Determine if there's a way to page search within the eCR Viewer that will find data in collapsed sections (i.e., the labs that are automatically collapsed on open).

Why it needs to be done

Searching is in the MVP designs for the eCR Viewer, but has not yet been implemented. Default page search functionality (cmd + f) is a partial solution, but it doesn't search through collapsed sections.

Timebox

2 days

To-do list

emmastephenson commented 1 week ago

https://developer.chrome.com/docs/css-ui/hidden-until-found

JNygaard-Skylight commented 3 days ago

hidden=until-found is experimental and of the top 4 browsers, is only supported by Chrome and Edge. Because of that it will not be added to Typescript's web types . To use it we would need to fork the TypeScript-DOM-lib-generator.

The next thing I want to look into is using a combination of CSS and TypeScript to emulate until-found. I.e., using some combination of max-height: 0 and overflow:hidden so that the content is in the DOM but not visible. There is hopefully a way to expand the accordion when the search goes to the content of the closed accordion.

Regardless of what we do, we will need to fork the Trussworks' react-usds accordion component.