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

Avoid triggering search when s is pressed on active input. #2507

Open
ericholscher opened this issue Dec 17, 2024 · 1 comment
Open

Avoid triggering search when s is pressed on active input. #2507

ericholscher opened this issue Dec 17, 2024 · 1 comment
Labels
C-bug Category: A bug, incorrect or unintended behavior

Comments

@ericholscher
Copy link

Problem

We're trying to add a custom search element to mdbook docs, and the default search logic keeps stealing the s key when we try to type it into the search box of our alternate search.

Steps

  1. To go https://test-builds.readthedocs.io/en/mdbook/
  2. Press / to bring up our custom search
  3. Try to type a word with s in it.

Possible Solution(s)

The mdbook search logic should not fire when there is an input element that has focus.

It seems like https://github.com/rust-lang/mdBook/blob/master/src/theme/searcher/searcher.js#L319 should be checking for input types as well as textarea types?

Notes

No response

Version

mdbook v0.4.43
@ericholscher ericholscher added the C-bug Category: A bug, incorrect or unintended behavior label Dec 17, 2024
@ehuss
Copy link
Contributor

ehuss commented Dec 18, 2024

It should already be checking for input via the check on e.target.nodeName. Maybe attach a debugger and see why that isn't included?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: A bug, incorrect or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants