Fix/app search (#456)

* Auto open search correctly in global search

* Update search input when navigating to previous/next location

* Revert: Navigate to previous page when canceling search

Has to many edge cases and fixing them would require a global history stack which gets saved in the location state.
This then would lead to the apps internal back navigation to be the same as the browsers which is not wanted, since you should not get moved deeper into the apps navigation when clicking the back button

* Correctly autofocus search input

Sometimes the autofocus did not work, since the input did not exist yet by the time the timeout was triggered

* Restore search input open state when navigation to previous/next location

* Restore search input focus when navigating to previous/next location
This commit is contained in:
schroda
2023-11-12 19:04:40 +01:00
committed by GitHub
parent 35c34b6d1b
commit 8d4687428f
3 changed files with 58 additions and 33 deletions

View File

@@ -161,7 +161,7 @@ export const SearchAll: React.FC = () => {
const { setTitle, setAction } = useContext(NavBarContext);
useSetDefaultBackTo('sources/all/search');
useSetDefaultBackTo('sources');
const [query] = useQueryParam('query', StringParam);
const searchString = useDebounce(query, TRIGGER_SEARCH_THRESHOLD);