docusaurus
docusaurus copied to clipboard
triggering search via cmd+k captures all future keystrokes
Have you read the Contributing Guidelines on issues?
- [x] I have read the Contributing Guidelines on issues.
Prerequisites
- [x] I'm using the latest version of Docusaurus.
- [ ] I have tried the
npm run clearoryarn clearcommand. - [ ] I have tried
rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages. - [ ] I have tried creating a repro with https://new.docusaurus.io.
- [ ] I have read the console error message carefully (if applicable).
Description
Once someone has entered the search component via cmd+K, all future keystrokes are sent to the search even when it's closed. This makes it impossible to use commands like cmd+R or cmd+L because they are captured in search.
I've tested this on a mac using chrome. It is reproducible on https://docusaurus.io/ as well as my site running docusaurus 3.9.2 and 3.8.1.
Reproducible demo
reproducible on the Docusaurus docs
Steps to reproduce
- go to https://docusaurus.io/
- enter
cmd+Kto bring up search - enter
escapeto close search - enter
cmd+Rto reload. Notice that this doesn't reload the page but instead opens the search modal with the textr
Expected behavior
Commands like cmd+R and similar are executed properly and not captured by search.
Actual behavior
the text is captured in the search input
Your environment
- Public source code: https://docusaurus.io/
- Public site URL: https://docusaurus.io/
- Docusaurus version used: I've reproduced on 3.9.2 and 3.8.1
- Environment name and version (e.g. Chrome 89, Node.js 16.4): Chrome Version 142.0.7444.176 (Official Build) (arm64)
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): macOS Sequoia 15.6.1
Self-service
- [ ] I'd be willing to fix this bug myself.