Skip to content

Commit

Permalink
Don't dismiss the command palette when the new tab menu closes
Browse files Browse the repository at this point in the history
Transient UIs are hard.

Regressed in #15077.

Closes #15305
  • Loading branch information
zadjii-msft committed May 12, 2023
1 parent c6215c8 commit 9226086
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/cascadia/TerminalApp/TerminalPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,14 @@ namespace winrt::TerminalApp::implementation
});
// Necessary for fly-out sub items to get focus on a tab before collapsing. Related to #15049
newTabFlyout.Closing([this](auto&&, auto&&) {
_FocusCurrentTab(true);
if (const auto p = CommandPaletteElement(); p && p.Visibility() == Visibility::Visible)
{
// Don't focus the terminal, that'll dismiss the command palette.
}
else
{
_FocusCurrentTab(true);
}
});
_newTabButton.Flyout(newTabFlyout);
}
Expand Down

0 comments on commit 9226086

Please sign in to comment.