Comment by gastonmorixe
16 hours ago
Has someone ever found a good solution for long / infinite lists / grids virtualization not breaking browsers native text search?
Maybe for this we need a new web "Search" API instead of JS. Not sure it can be done otherwise without browser's help.
https://wicg.github.io/virtual-scroller/#find-in-page-apis
As far as I can tell, this went basically nowhere. Except this:
https://github.com/WICG/display-locking
https://developer.mozilla.org/en-US/docs/Web/API/Element/bef...
Native search only sees the DOM. Once you virtualize a list or grid, offscreen rows do not exist as nodes, so Ctrl-F cannot match them unless you keep enough hidden text around to erase most of the win from virtualization.
A browser API could help, but it would need to hook into selection, focus, scroll position, and match navigation across content the page has not rendered yet. That is a much bigger contract than 'search this string', and I would not bet on sites using it consistently.