Repository navigation
Conversation
The Uno-only overflow popup Closed hook queued IsOpen = false on every popup close, including the one CommandBar.OnClosed performs itself, so an app reopening the bar from its Closed handler was closed again in a loop. WinUI has no such hook, and light-dismiss already reaches the CommandBar through PopupPanel. Unloading an open bar no longer closes it either: IsOpen stays set and the overflow reopens when the bar is loaded again, as in WinUI. Fixes #24671 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Unloading an open CommandBar closes its overflow popup but leaves IsOpen set, so the bar reopens when it is loaded again, as in WinUI. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Xiaoy312
marked this pull request as ready for review
November 25, 2026 16:25
Check that clicking outside and pressing Escape in the overflow both reset IsOpen, and that reopening from Closed leaves the labels uncompacted. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
Xiaoy312
enabled auto-merge
November 25, 2026 16:37
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
Contributor
|
The build 249074 found UI Test snapshots differences: Details
|
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.
GitHub Issue: closes #24671
PR Type:
🐞 Bugfix
What changed? 🚀
Reopening a
CommandBarfrom its ownClosedhandler (which WinUI'sCommandBar::OnClosedImplexplicitly supports) made it flip open and closed in a tight loop.Closedfired hundreds of times before the bar settled open.The cause was an Uno-only handler on the overflow popup's
Closedevent that queuedIsOpen = falseat idle priority on every popup close, including the close thatCommandBar.OnCloseditself performs. That queued close undid the app's reopen and started the cycle again. WinUI has no such handler.This PR removes it. Clicking outside the bar still closes it:
PopupPanelalready routes an outside press toCommandBar.TryDismissInlineAppBarInternal().Behavior change, now matching WinUI: unloading an open bar no longer closes it. Before, the popup closing on unload triggered the removed handler, which set
IsOpen = falseand raisedClosed. NowIsOpenstays set, and the overflow reopens when the bar is loaded again (AppBar.OnLoaded).Other ways of closing the overflow popup directly, without going through the bar, also leave
IsOpenset:VisualTreeHelper.CloseAllPopups(internal, used by tests), re-applying the template while the bar is open, and UI Automation's Close on the popup. WinUI has the same gap.Tests
Given_CommandBar.When_Reopened_From_Closed_Handler_Then_Settles_Open:Closedfires once and the bar and its overflow popup end up open.Given_CommandBar.When_Unloaded_While_Open_Then_Reopens_On_Reload:IsOpensurvives unload with noClosed, and the popup reopens on reload.Given_CommandBar.When_Escape_Pressed_In_Overflow_Then_Closes: Escape with focus in the overflow closes the bar and its popup. It's excluded on native WinUI, where the test keyboard helper sends no keys.Given_CommandBar.When_Popup_Open_Then_Click_Outsidenow also checks that clicking outside resetsIsOpen, since that's the only remaining way an outside click reaches the bar.Validation
Closedcalls, andIsOpenreset on unload.Given_CommandBarandCommandBarIntegrationTestsran 48 tests with 0 failures. That includesValidateInlineCommandBarLightDismissBehavior, which covers closing the bar by clicking outside it.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code