elastic / search-ui

Search UI. Libraries for the fast development of modern, engaging search experiences.
https://docs.elastic.co/search-ui
Apache License 2.0
1.92k stars 368 forks source link

Issue with browser navigating back to our search page using NextJs #1072

Closed j23schoen closed 2 weeks ago

j23schoen commented 2 months ago

Background:

What's happening?

We have a search page that's using the SearchProvider component to wrap all the filters, results, etc. The search results include a link to another page (not another search page, but a more detailed page about the item you clicked). You click the link and you're redirected to the new page, but, when you click the browser navigation to go back to the search page there's no redirect. The url does get updated to the correct search page url which for us is /profiles/search, but you remain on the item detail page.

I've done a lot of debugging and am pretty sure I've narrowed it down to the SearchProvider component. If I remove the usage of SearchProvider entirely the navigation works. I've tried adding a randomly generated key to the provider but that doesn't work. I've tried a dozen other things with console logs to say that the component has remounted but it never does on browser navigation.

botelastic[bot] commented 3 weeks ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Is this issue still important to you? If so, please leave a comment and let us know. As always, thank you for your contributions.