fix: context menus on flyout (#9116)

This commit is contained in:
Maribeth Moffatt
2025-05-30 11:00:56 -07:00
committed by GitHub
parent fdffd6558b
commit d1b17d1f90

View File

@@ -2806,10 +2806,11 @@ export class WorkspaceSvg
/** See IFocusableTree.onTreeBlur. */
onTreeBlur(nextTree: IFocusableTree | null): void {
// If the flyout loses focus, make sure to close it unless focus is being
// lost to the toolbox.
// lost to the toolbox or ephemeral focus.
if (this.isFlyout && this.targetWorkspace) {
// Only hide the flyout if the flyout's workspace is losing focus and that
// focus isn't returning to the flyout itself or the toolbox.
// focus isn't returning to the flyout itself, the toolbox, or ephemeral.
if (getFocusManager().ephemeralFocusTaken()) return;
const flyout = this.targetWorkspace.getFlyout();
const toolbox = this.targetWorkspace.getToolbox();
if (toolbox && nextTree === toolbox) return;