prevent double-highlighting
Created by: sqs
This fixed a bug I saw where rerenders of an ancestor component caused highlights to be applied multiple times. This resulted in the background color of the highlighted text getting darker and darker because it had multiple wrapping elements with partial opacity.
The highlightNodeHelper
has a check to prevent this case, but it was not effective.
I am not able to reproduce the issue on our search results page anymore. Previously I could reproduce it by pressing return in the query input field. I will leave open this draft PR in case I or anyone else can repro it.