CmdPal: Fix search box text selection in ShellPage.GoHome#42937
Merged
michaeljolley merged 1 commit intomicrosoft:mainfrom Oct 26, 2025
Merged
Conversation
Fixes an issue where GoHome wouldn’t select the search box text if the current page was already the home page. In this case, the navigation stack is empty, and no code is executed because focusing the text was previously delegated to the “navigate back” operation.
michaeljolley
approved these changes
Oct 26, 2025
Collaborator
Author
vanzue
pushed a commit
that referenced
this pull request
Oct 27, 2025
## Summary of the Pull Request This PR fixes an issue where `ShellPage.GoHome` wouldn’t select the search box text when the current page was already the home page. In that case, the navigation stack was empty, and no code was executed because focusing the text had been delegated to the `GoBack` operation. ## Change log one-liner Ensured search text is selected when Go home when activated and Highlight search on activate are both enabled. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] Closes: #42443 - [x] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [x] **Tests:** Added/updated and all pass - [x] **Localization:** All end-user-facing strings can be localized - [x] **Dev docs:** Added/updated - [x] **New binaries:** Added on the required places - [x] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR optimizes the focus behavior in the GoHome navigation method to improve performance by deferring focus operations until all back-navigation steps complete, rather than focusing the search box on each intermediate step.
Key changes:
- Modified
GoHometo passfocusSearch: falsetoGoBackduring the navigation loop - Added explicit search box focus logic after the navigation loop completes
- Ensures focus is set even when already at home (no navigation needed)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary of the Pull Request
This PR fixes an issue where
ShellPage.GoHomewouldn’t select the search box text when the current page was already the home page.In that case, the navigation stack was empty, and no code was executed because focusing the text had been delegated to the
GoBackoperation.Change log one-liner
Ensured search text is selected when Go home when activated and Highlight search on activate are both enabled.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed