Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(a11y): backport docusaurus search bar focus fix #1331

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 160 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@
"version-python": "npm run prepare-python && docusaurus docs:version stable && cp -r docs/* python/docs/ && cp -r versioned_docs/* python/versioned_docs/ && cp -r versioned_sidebars/* python/versioned_sidebars/ && cp versions.json python/",
"cleanup": "rm -rf docs versioned_docs versioned_sidebars docusaurus.config.ts versions.json sidebars.js",
"version-all": "npm run version-python && npm run version-node && npm run version-java && npm run version-dotnet",
"serve": "docusaurus serve"
"serve": "docusaurus serve",
"postinstall": "patch-package"
},
"dependencies": {
"@docusaurus/core": "3.0.0",
"@docusaurus/plugin-content-docs": "3.0.0",
"@docusaurus/preset-classic": "3.0.0",
"@docusaurus/types": "3.0.0",
"clsx": "^2.0.0",
"patch-package": "^8.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-lite-youtube-embed": "^2.3.52",
Expand Down
12 changes: 12 additions & 0 deletions patches/@docusaurus+theme-search-algolia+3.0.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/node_modules/@docusaurus/theme-search-algolia/lib/theme/SearchBar/index.js b/node_modules/@docusaurus/theme-search-algolia/lib/theme/SearchBar/index.js
index 4e5b33d..6c2894b 100644
--- a/node_modules/@docusaurus/theme-search-algolia/lib/theme/SearchBar/index.js
+++ b/node_modules/@docusaurus/theme-search-algolia/lib/theme/SearchBar/index.js
@@ -86,6 +86,7 @@ function DocSearch({contextualSearch, externalUrlRegex, ...props}) {
const onClose = useCallback(() => {
setIsOpen(false);
searchContainer.current?.remove();
+ searchButtonRef.current?.focus();
}, [setIsOpen]);
const onInput = useCallback(
(event) => {
Loading