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

Issues with Highlighting - How to stop the Highlighting? #28

Closed Zamiell closed 3 years ago

Zamiell commented 3 years ago

Hello and thanks for the excellent plugin.

One nice feature of this plugin is that after searching for something and clicking on a result, the search term is helpfully highlighted in yellow across the entire page.

Example (which is cropped a bit):

image

While highlighting is probably helpful by default, in some cases it won't be helpful, because the search term is so common. For example, in the above screenshot, the page is now difficult to read because of all of the yellow spam/noise. Thus, after seeing this, users will attempt to find a way to un-highlight the words:

1) Their first assumption would be to try deleting the search term in the top-right-hand-corner. Handily, there is an blue X there. Unfortunately, clicking on that does delete the search term, but does not delete the highlighting.

2) Their second assumption will be to refresh the page, but even that does not remove the highlighting. (Because it is baked into the URL.)

3) Finally, users will resort to manually navigating away from the page, and then manually navigating back. This will finally result in the highlighting being removed. (Alternatively, if they happen to notice the "highlight" query parameter, they could manually remove that, and then refresh the page, but this is even more cumbersome.)

In conclusion, this is a frustrating user experience. I propose that when the blue X is clicked, it also removes the highlighting.

cmfcmf commented 3 years ago

Thank you for your detailed report! This behavior will be somewhat improved by #34, which removes the highlighting when reloading or navigating from the page.

cmfcmf commented 3 years ago

The updated behaviorhas now been released as part of https://github.com/cmfcmf/docusaurus-search-local/releases/tag/v0.6.0. 🎉 Please let me know if that works for you.