**Steps to replicate the issue** (include links if applicable):
* Edit a page with VisualEditor
* Open the find and replace dialogue (e.g. `Ctrl`+`F`, or hamburger menu ("page options") in VE top bar → "Find and replace")
* Enter a "Find" query that is in fact present on the page
* Edit the query (e.g. by adding or removing a character) to form a new query that is not present on the page
**What happens?**:
After editing the query to form a new non-present query, the last selected match remains highlighted.
**What should have happened instead?**:
As the new query no longer has any matches, it should no longer be highlighted.
**Software version**: Tested on English Wikipedia & Meta-Wiki (1.45.0-wmf.22).
**Other information**: Tested on Firefox 144.0b4 & Chrome 141.0.7390.76.
**Screenshots**:
After initial query:
{F66751834}
After editing:
{F66751836}
{F66751839}