Skip to content

Clear text selection when search string is emptied#588

Open
chall37 wants to merge 1 commit into
gnachman:masterfrom
chall37:fix-search-highlight-persist
Open

Clear text selection when search string is emptied#588
chall37 wants to merge 1 commit into
gnachman:masterfrom
chall37:fix-search-highlight-persist

Conversation

@chall37
Copy link
Copy Markdown
Contributor

@chall37 chall37 commented Feb 21, 2026

When you type a search string and delete it character by character, the first matching character stays selected after the search box is empty. It looks like findViewControllerClearSearch clears the highlight map but not the text selection that was placed on the current match. Adding a clearSelection call clears it.

Note: This change also clears selection when closing the Find Bar.

When the search string is emptied, clearHighlights removes the highlight
map but leaves the text selection created by findOnPageSelectRange. This
causes the first matching character to remain visually selected after all
search highlights are gone.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant