Skip to content

"Case Sensitive" option in "Find & Replace" not Working as expected when replacing all

In the "Find & Replace" feature, when "Case sensitive" is selected, the "replace all" functionality still replaces words regardless of case, which is inconsistent with the expected behavior.

Expected behavior

When "Case sensitive" is selected, the "replace all" functionality should only replace words that match the case of the search term.

Current behavior

The "replace all" functionality does not honor the "Case sensitive" option and replaces words regardless of case.

Steps to reproduce

[Provide a link to a live example or screenshots, and the steps to reproduce this bug]

  1. Click on the "Find & Replace" button in the toolbar
  2. Click on the ellipsis so you can see the replace field too
  3. Check the "Case sensitive" option
  4. Search for and replace a specific word, ensuring that the word has both uppercase and lowercase versions within the text
  5. Click the "replace all" button
  6. Check that all the words that matched to what you searched, no matter the case, are replaced

In the screenshot below, I am searching "CONTENT" and after checking "Case Sensitive", it finds only one option: image__8_

Clicking "Replace all" will actually replace all the three words even though only one of them matched the case, as in the screenshot below: image__9_

Environment

[Provide browser name and version and if you're working from a PC or Mac]

Possible solution

[Not required. Suggest a fix for the bug]