From 7938803747ff3af0451aefcc9725d4a88681a85b Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Thu, 14 Mar 2024 17:26:26 +0100 Subject: [PATCH] fix(a11y): move focus algolia-search focus back to search input on Escape (#9945) --- .../src/theme/SearchBar/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/docusaurus-theme-search-algolia/src/theme/SearchBar/index.tsx b/packages/docusaurus-theme-search-algolia/src/theme/SearchBar/index.tsx index 9a3a4ae3bc9a..1d5096a1a007 100644 --- a/packages/docusaurus-theme-search-algolia/src/theme/SearchBar/index.tsx +++ b/packages/docusaurus-theme-search-algolia/src/theme/SearchBar/index.tsx @@ -150,6 +150,7 @@ function DocSearch({ const onClose = useCallback(() => { setIsOpen(false); searchContainer.current?.remove(); + searchButtonRef.current?.focus(); }, [setIsOpen]); const onInput = useCallback(