Skip to content

Commit 0ec2ce5

Browse files
committed
chore: Add comment clarifying resolution of workspaces for checking navigability.
1 parent cc5238a commit 0ec2ce5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/navigation.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,13 @@ export class Navigation {
824824
* @returns whether keyboard navigation is currently allowed.
825825
*/
826826
canCurrentlyNavigate(workspace: Blockly.WorkspaceSvg) {
827+
// Only the main/root workspace has the accessibility mode bit set; for
828+
// nested workspaces (mutators or flyouts) we need to walk up the tree.
829+
// Default to the root workspace if present. Flyouts don't consider
830+
// their workspaces to have a root workspace/be a nested child, so fall
831+
// back to checking the target workspace's root (`.targetWorkspace` only
832+
// exists on flyout workspaces) and then fall back to the target/main
833+
// workspace itself.
827834
const accessibilityMode = (
828835
workspace.getRootWorkspace() ??
829836
workspace.targetWorkspace?.getRootWorkspace() ??

0 commit comments

Comments
 (0)