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, highlighting matches, of which one is initially selected
- 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 match that was selected before editing 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:
After editing:



