Steps to reproduce
Start with regular item open. Note that the URL has a valid doc ID, which will be marked in green:
Cmd-F and start typing search term. As you type, the items not matching your search get filtered out, in this case producing no results. Note the URL has your doc ID plus your search query in q parameter.
Not finding any results, hit Cmd-Enter as the filter dropdown suggests to expand search to all documents. Note the URL now has no doc ID, only search query.
Not finding any results still, hit Esc to back out. URL has stayed the same.
Oh well, that search was hopeless, let’s hit Esc again to get back to what we were doing. Doc URL was lost, and you’re nowhere.
Retain doc ID for search to allow the user to properly back out of global search. Esc in step 3 should go back to step 2. Then Esc again should go back to step 1.
MS Edge 79.0.287.2, macOS 10.14.6