Description
The UX for navigating after a search in the documentation in incorrect. Upon searching in the documentation, the search takes over the contents of the current page, i.e. it is not displayed in a lightbox or pop-up div. In this case, the use of the back navigation button should act as exiting the search and returning to the page in the documentation that the user was on prior to triggering the search feature.
In practice, using the back button goes back to the 2nd to last page the user was on before triggering search, and a backwards-then-forwards double navigation is required to end up on the page that the user was on before search.
The solution is to use the history push state api to add an entry to the backwards navigation stack that would return the user to the last-viewed page upon triggering the search after clicking the backwards navigation button.
(Yes, I am aware that it is possible to close the search box and go back to the last page via other means. The point is that the content of the window act as if a full navigation has taken place, in which case the most natural means of returning to the original content for the user is to press the back button and not escape, etc.)