cmfcmf / docusaurus-search-local

Offline / Local Search for Docusaurus v2. Try it live at:
https://cmfcmf.github.io/OpenWeatherMap-PHP-API/
MIT License
438 stars 67 forks source link

Unmark highlighting using keyboard #42

Open rtyurin opened 3 years ago

rtyurin commented 3 years ago

: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.

cmfcmf commented 3 years ago

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 👍

JPeer264 commented 1 year ago

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).

johnnyreilly commented 11 months ago

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