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
Same-page search result does not close search dropdown if search.highlight is disabled #4829
Comments
Thanks for reporting. However, this bug report is incomplete, as it doesn't include a reproduction and steps to reproduce. Please carefully read our new bug reporting guide and reopen the issue once you've provided all missing information. |
I updated the issue to more precisely state how to reproduce the issue. I have not provided a zip file to reproduce because you can simply use this repository's own documentation, with "search.highlight" disabled. I don't think I have permission to re-open the issue myself. |
Note: A likely solution to the issue would be to add an |
Please provide a reproducible example despite it being reproducible on the docs. When you don't do the work, I have to do it, as I know have to craft a smaller example up to better debug it. When the bug is fixed, it can be tested on the whole docs, but for debugging and inspection, a good minimal example goes a long way. See the reproduction guide how to do that, which is by the way also linked in the bug reporting guide. |
I updated the issue description to include a reproduction. |
Fixed in 8a812ae. The search now closes every time a search result is selected. Before, this was not handled, but rarely occurred, because it only affected same-page results for which the location didn't change, i.e. anchor already in view. Thanks for providing the reproduction! I know that you're maintaining Sphinx Immaterial, a Sphinx-port of my work. I also understand that the new bug reporting process might feel a little boilerplatey at first, but it greatly helps us to provide bug fixes much quicker than ever before. Thanks for sticking to it! |
Released as part of 9.0.3. |
Context
No response
Bug description
When the
search.highlight
feature is disabled, and a search result URL is exactly the same as the current URL and contains a#fragment
, then clicking on the search result does not close the search dropdown, which is confusing.Additionally, there is some inconsistency as to whether the search query remains in the search bar:
navigation.instant
is enabled, then the query always remains in the search bar after selecting a resultnavigation.instant
is disabled andsearch.highlight
is enabled, the query never remains in the search bar after selecting a result, since the addition of the highlight term to the query string means the page is always reloaded.navigation.instant
is disabled andsearch.highlight
is disabled, then if the result is on the same page, the query remains, otherwise the query does not remain.Related links
N/A
Reproduction
example.zip
Steps to reproduce
Browser
Chrome
Before submitting
The text was updated successfully, but these errors were encountered: