Skip to content

Fix File Explorer search box losing focus after Ctrl+F#20022

Merged
seanbudd merged 5 commits into
nvaccess:masterfrom
cary-rowen:fix-explorer-search-pane-focus
May 8, 2026
Merged

Fix File Explorer search box losing focus after Ctrl+F#20022
seanbudd merged 5 commits into
nvaccess:masterfrom
cary-rowen:fix-explorer-search-pane-focus

Conversation

@cary-rowen
Copy link
Copy Markdown
Contributor

@cary-rowen cary-rowen commented Apr 27, 2026

Link to issue number:

Fixes #20021

Summary of the issue:

In File Explorer on Windows 10, pressing Ctrl+F should move focus directly to the search edit field. Since NVDA 2026.1 beta, NVDA first reports the search edit field, but then reports a pane, so users need to press Ctrl+F a second time before they can reliably type in the search box.

This is a regression from #19117. That PR removed several old Windows 8.x Start screen workarounds from the Explorer app module, including SearchBoxClient. Although that class was described as a Windows 8 workaround, it was still filtering a redundant File Explorer search band focus event. On Windows 10, the redundant object has:

role == controlTypes.Role.PANE
windowClassName == "Search Box"

Description of user facing changes:

Same behavior as before 2026.1Beta.

Description of developer facing changes:

Restores a small Explorer app module overlay for File Explorer search band pane objects. The overlay suppresses redundant IAccessible focus events from Search Box and UniversalSearchBand pane objects.

Search Box has been confirmed on Windows 10. UniversalSearchBand is retained from the pre-#19117 filter because it appears to be another Explorer search band class, and the match is still limited to IAccessible pane objects.

Description of development approach:

This keeps the #19117 cleanup intact, except for the part that affected File Explorer search focus. The Windows 8 Start screen tile, group, launcher, and suggestion overlays are not restored.

Testing strategy:

Manual testing:

  1. Start NVDA with add-ons disabled.
  2. Open File Explorer on Windows 10.
  3. Move focus to the file list.
  4. Press Ctrl+F.
  5. Confirm that NVDA reports the search edit field and does not then report pane.
  6. Confirm that typing immediately enters text into the search box.

Known issues with pull request:

None known.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation: Not needed.
    • Developer / Technical Documentation: Not needed.
    • Context sensitive help for GUI changes: Not applicable.
  • Testing:
    • Unit tests: Not included; this depends on Explorer focus events.
    • System (end to end) tests: Not included.
    • Manual testing: Planned / required on Windows 10 File Explorer.
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers: Not applicable.
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@cary-rowen
Copy link
Copy Markdown
Contributor Author

cc @josephsl

I apologize for bothering you, since you are the author of #19117.

Do you know if UniversalSearchBand might exist in Windows 10?

Thanks

@cary-rowen cary-rowen marked this pull request as ready for review April 27, 2026 08:53
@cary-rowen cary-rowen requested a review from a team as a code owner April 27, 2026 08:53
@cary-rowen cary-rowen requested a review from SaschaCowley April 27, 2026 08:53
@josephsl
Copy link
Copy Markdown
Contributor

Hi,

Looks like a regression from my own File Explorer cleanup work. I thought universal search band was a Windows 8.x thing but looks like it should not have been removed. This issue is not seen in Windows 11.

Keep in mind that Windows 10 is in extended security updates phase.

Thanks.

@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Apr 28, 2026
@seanbudd
Copy link
Copy Markdown
Member

seanbudd commented May 8, 2026

can you add a changelog entry for this please?

@seanbudd seanbudd marked this pull request as draft May 8, 2026 01:17
Comment thread user_docs/en/changes.md Outdated
Copy link
Copy Markdown
Member

@seanbudd seanbudd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cary-rowen

@seanbudd seanbudd marked this pull request as ready for review May 8, 2026 01:41
Copilot AI review requested due to automatic review settings May 8, 2026 01:41
@seanbudd seanbudd enabled auto-merge (squash) May 8, 2026 01:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a regression in the File Explorer app module where pressing Ctrl+F in Windows 10 would briefly focus the search edit field and then immediately move focus to a redundant search-band pane, requiring a second Ctrl+F.

Changes:

  • Reintroduces a small SearchBoxClient IAccessible overlay that suppresses redundant MSAA focus events for Explorer search-band pane objects ("Search Box" / "UniversalSearchBand").
  • Updates chooseNVDAObjectOverlayClasses to apply this overlay early for matching pane objects.
  • Adds a user-facing “What’s New” entry documenting the fix.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
source/appModules/explorer.py Adds an overlay and overlay-selection rule to suppress redundant search-band pane focus events in File Explorer.
user_docs/en/changes.md Documents the File Explorer Ctrl+F focus regression fix in the 2026.2 bug fixes list.

Comment thread user_docs/en/changes.md
@seanbudd seanbudd disabled auto-merge May 8, 2026 02:52
@seanbudd seanbudd merged commit 6c46ae7 into nvaccess:master May 8, 2026
38 of 41 checks passed
@github-actions github-actions Bot added this to the 2026.2 milestone May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File Explorer search box loses focus to a pane after pressing Ctrl+F in NVDA 2026.1

4 participants