Closed Bug 1753992 Opened 4 years ago Closed 4 years ago

Only the searched section is displayed in the “More From Mozilla” page if the section name is cleared from the “Find in Settings” search box using the “Backspace” key

Categories

(Firefox :: Settings UI, defect, P3)

Desktop
All
defect

Tracking

()

VERIFIED FIXED
99 Branch
Tracking Status
firefox-esr91 --- disabled
firefox97 --- wontfix
firefox98 --- wontfix
firefox99 --- verified

People

(Reporter: srosu, Assigned: enndeakin)

References

Details

Attachments

(1 file, 1 external file)

Attached image MFM_broken.gif —

[Affected versions]:

  • Firefox Nightly 98.0a1 (Build ID: 20220206212741)
  • Firefox Release Candidate 97.0 (Build ID: 20220202182137)

[Affected Platforms]:

  • Windows 10 x64
  • MacOS 11.6
  • Ubuntu 20.04

[Prerequisites]:

  • Have the Firefox browser en-US build installed and opened.
  • Have the “browser.search.region” pref set to the “US” value.
  • Have the “browser.preferences.moreFromMozilla” pref set to the “true” value.

[Steps to reproduce]:

  1. Navigate to the “about:preferences” page.
  2. Search for “Firefox Mobile”/“Mozilla VPN”/”Mozilla Rally” using the “Find in Settings” search box.
  3. Delete the searched term by keeping the “Backspace” key pressed.
  4. Focus the “More From Mozilla” section.
  5. Observe the displayed sections.

[Expected result]:

  • All the sections are displayed on the page.

[Actual result]:

  • The section searched at step 2 is the only one displayed on the page.

[Notes]:

  • All the sections from the “More From Mozilla” page are redisplayed after a page refresh.
  • I have observed that this issue is also reproducible on the “Nightly Experiments” section from the "about:preferences" page.
  • This issue is not reproducible when the searched term is deleted using the “x” button from the “Find in Settings” search box or by selecting the term and pressing the “Delete”/”Backspace” key.
  • Attached is a screen recording of the issue.

I managed to reproduce this issue even if the "More From Mozilla" feature is turned off by the pref.

  • I've tried to search for the "Nightly experiments" section using the steps from the bug's description and the behavior is also happening for this section.

Thanks Simona for verifying. Updating to help triage issue under Preferences component

Component: Messaging System → Preferences
No longer blocks: mfm, 1752851

This is an issue with the subItem logic that got added in bug 1667858.

The code for clearing subitems looks like this:

  removeAllSearchIndicators(window, showSubItems) {
    this.getFindSelection(window).removeAllRanges();
    this.removeAllSearchTooltips();
    this.removeAllSearchMenuitemIndicators();

    // Make any previously hidden subitems visible again for the next search.
    if (showSubItems && this.subItems.size) {
      for (let subItem of this.subItems.keys()) {
        subItem.classList.remove("visually-hidden");
      }
    }

    this.subItems.clear();
  }

When pressing backspace one by one, we hit this code for every keydown (input) event, and the first time, showSubItems is still false (it's equivalent to !query.length, here. So we don't remove the visually-hidden classes. But we do clear this.subItems, so when the same method gets called later and showSubItems is eventually true because there is no more query, this.subItems is an empty map and we don't remove any classes.

Neil, does the .clear call just need to live inside the if condition or is there a more complicated fix needed?

Blocks: 1667858
Flags: needinfo?(enndeakin)
Priority: -- → P3
Assignee: nobody → enndeakin
Status: NEW → ASSIGNED

Couldn't get a test working for this. The failure only occurs when the delete key is held down and the test timing doesn't seem to be able to emulate this right.

Flags: needinfo?(enndeakin)
Pushed by neil@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ec5fc3a5bbf3 don't clear subitems from preferences find when the input field is empty, r=preferences-reviewers,mstriemer
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch

I‘ve verified this issue using the latest Firefox Nightly 99.0a1 (Build ID: 20220223093800) on Windows 10 x64, macOS 11.6, and Ubuntu 20.04.

  • All the sections are displayed on the “about:prefrences” pages after clearing the section name from the “Find in Settings” search box using the “Backspace” key.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: