Whitespace handling issues with pasted page searches #26650
Labels
Chromium/waiting upstream
Issue is in Chromium; we'll likely wait for the fix
OS/Desktop
priority/P5
Not scheduled. Don't anticipate work on this any time soon.
repros-on-chrome
Description
When using page search (^f), a pasted search string gets transformed right in the search field, with no indication to the user, and occurrences of the modified string are matched.
Whitespace is stripped on both sides, but a search for any combination of whitespace characters alone becomes a search for a single space.
This makes certain searches impossible/results incorrect - such as when searching for a tab (or many), or searching for text indented by some number of tabs, or with trailing tabs. The same applies to spaces when pasted, but not when typed in (which is a bit more problematic for tabs).
There is a workaround - if a search string is pasted with whitespace in the middle, it is preserved and if the characters around the whitespace are removed, a search for whitespace in any location in the search string becomes possible and the matches are correct.
However, occurrences of tabs are not highlighted, unless the text containing them is selected.
And lastly, this is just a consequence of the above - if the workaround is used (or the search string is typed in manually) to successfully search for text with whitespace on either side and the search string is selected and copied from the search field and pasted back, it becomes a different search string - with whitespace stripped on both ends, so the actual matches change.
Steps to Reproduce
Actual result:
See: above
Expected result:
There's a few issues here. Tabs should be highlighted when found. As for the rest - a checkbox on the search field to preserve surrounding whitespace could be a solution.
Reproduces how often:
Easily reproduced
Brave version (brave://version info)
Version/Channel Information:
Other Additional Information:
Miscellaneous Information:
Arch Linux
The text was updated successfully, but these errors were encountered: