docusaurus-search-local icon indicating copy to clipboard operation
docusaurus-search-local copied to clipboard

Unmark highlighting using keyboard

Open rtyurin opened this issue 3 years ago • 3 comments

:unicorn: Hello, first of all - great plugin, really easy to setup and use! What is my only concern - is there a way to cancel highlighting marks when you are already got to the needed page? It can be annoying, especially when you type in your search only one letter and already getting the results you are looking for, but after you go to the page you're looking for, it highlights every word with the letter you searched for. It just would be nice to unmark all highlighted results for this page on for example an ESC key using keyboard. I can even make a pull request with this feature if needed.

rtyurin avatar Jun 08 '21 11:06 rtyurin

Hi! Have you seen #28? It also contains a few ideas regarding highlighting. I am open for pull requests that improve the highlighting behavior. Pressing ESC seems like a good idea 👍

cmfcmf avatar Jun 11 '21 07:06 cmfcmf

ESC seems to be a good idea indeed, however this would be not really visible to the user (and impossible for mobile users). Best (and the hardest to implement on this point) is to have a default value in the searchbar and allow the user to clear the search, maybe with an X on the right side. But that is rather hard to implement as this lib is using the SearchBar from docusaurus or docsearch to be more specific.

Also it would be nice to have an option to disable mark highlighting. I will create a PR if that is wanted (I will create a separate PR with the ESC as well).

JPeer264 avatar Nov 21 '22 12:11 JPeer264

I'd really like to see a way to disable the yellow highlighting also

johnnyreilly avatar Oct 17 '23 10:10 johnnyreilly