Skip to content

Commit 183df93

Browse files
committed
refactor: Adjust retrieval of flyout elements.
1 parent 2a5cfaf commit 183df93

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

core/workspace_svg.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2729,12 +2729,15 @@ export class WorkspaceSvg
27292729
const flyout = this.targetWorkspace?.getFlyout();
27302730
if (this.isFlyout && flyout) {
27312731
// Return the first focusable item of the flyout.
2732-
for (const flyoutItem of flyout.getContents()) {
2733-
const elem = flyoutItem.getElement();
2734-
if (isFocusableNode(elem) && elem.canBeFocused()) {
2735-
return elem;
2736-
}
2737-
}
2732+
return (
2733+
flyout
2734+
.getContents()
2735+
.find((flyoutItem) => {
2736+
const element = flyoutItem.getElement();
2737+
return isFocusableNode(element) && element.canBeFocused();
2738+
})
2739+
?.getElement() ?? null
2740+
);
27382741
}
27392742
return this.getTopBlocks(true)[0] ?? null;
27402743
} else return null;

0 commit comments

Comments
 (0)