There was an error while loading. Please reload this page.
1 parent 2a5cfaf commit 183df93Copy full SHA for 183df93
1 file changed
core/workspace_svg.ts
@@ -2729,12 +2729,15 @@ export class WorkspaceSvg
2729
const flyout = this.targetWorkspace?.getFlyout();
2730
if (this.isFlyout && flyout) {
2731
// 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
+ return (
+ flyout
+ .getContents()
+ .find((flyoutItem) => {
+ const element = flyoutItem.getElement();
+ return isFocusableNode(element) && element.canBeFocused();
2738
+ })
2739
+ ?.getElement() ?? null
2740
+ );
2741
}
2742
return this.getTopBlocks(true)[0] ?? null;
2743
} else return null;
0 commit comments