From 6a2046fb5d06d147c07f8c0cc6b77d6740b44135 Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Mon, 19 May 2025 11:27:04 -0700 Subject: [PATCH 1/2] feat: Support activating focused icons. --- src/actions/enter.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/actions/enter.ts b/src/actions/enter.ts index 3fc4e254..3331fd9f 100644 --- a/src/actions/enter.ts +++ b/src/actions/enter.ts @@ -14,6 +14,7 @@ import { RenderedConnection, WorkspaceSvg, Field, + icons, FocusableTreeTraverser, } from 'blockly/core'; @@ -106,6 +107,8 @@ export class EnterAction { curNode instanceof WorkspaceSvg ) { this.navigation.openToolboxOrFlyout(workspace); + } else if (curNode instanceof icons.Icon) { + curNode.onClick(); } } From 9dd894e985df2508fef308e6bae2a98ea17e6b35 Mon Sep 17 00:00:00 2001 From: Aaron Dodson Date: Mon, 19 May 2025 11:27:12 -0700 Subject: [PATCH 2/2] fix: Add a focus indicator to icons. --- test/index.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/index.html b/test/index.html index 0afd3ed8..a594c011 100644 --- a/test/index.html +++ b/test/index.html @@ -104,7 +104,10 @@ .blocklyActiveFocus:is(.blocklyPath, .blocklyHighlightedConnectionPath), .blocklyKeyboardNavigation .blocklyActiveFocus.blocklyField - > .blocklyFieldRect { + > .blocklyFieldRect, + .blocklyKeyboardNavigation + .blocklyActiveFocus.blocklyIconGroup + > .blocklyIconShape:first-child { stroke: var(--blockly-active-node-color); stroke-width: var(--blockly-selection-width); } @@ -115,7 +118,10 @@ ), .blocklyKeyboardNavigation .blocklyPassiveFocus.blocklyField - > .blocklyFieldRect { + > .blocklyFieldRect, + .blocklyKeyboardNavigation + .blocklyPassiveFocus.blocklyIconGroup + > .blocklyIconShape:first-child { stroke: var(--blockly-active-node-color); stroke-dasharray: 5px 3px; stroke-width: var(--blockly-selection-width);