Method for Navigating Search in this Topic Results

Is there a handler to navigate previous and next through the recent “Search in this Topic” results?

Since lazy loading and virtual lists break browser native Find on all but the shortest topics I think it’s important to replicate that functionality.

I am pretty new to Discourse, I’ve done a search through the meta and the source but I didn’t turn anything up, but it seems like it would be pretty important so I might be missing it. Thanks!

I think arrow keys should do the trick. You can see the available keyboard shortcuts by clicking the keyboard button in the sidebar on desktop.

The goal is to traverse a topic without bouncing back and forth between the topic and the search results.

In long posts it’s difficult to keep your place in the results, especially as the scroll position resets each time you press a result.

So it would work like the j and k selectUp selectDown handlers except that it would skip over replies that weren’t part of the recent Search this topic results selecting only replies that were.

In my estimation it would be reasonable to persist an offscreen list of replies (like an array) and then simply index through them with previousResult nextResult handlers, resetting the list whenever a new topic was loaded or a new search was performed.

Of course keyboard shortcuts and/or buttons would then become trivial.