Skip to content

Commit bc58820

Browse files
committed
chore: couple of fixes.
This removes the passive indicator rendering since FocusManager handles it. It also updates part of toolbox navigation to select a first item if there isn't currently a selection (which state is now possible due to tab navigation).
1 parent 4888243 commit bc58820

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/actions/arrow_navigation.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,11 @@ export class ArrowNavigation {
166166
return isHandled;
167167
case Constants.STATE.TOOLBOX:
168168
// TODO: Move this into cursor?
169-
isHandled = toolbox.selectNext();
169+
if (!toolbox.getSelectedItem()) {
170+
const firstItem = toolbox.getToolboxItems().find((item) => item.isSelectable()) ?? null;
171+
toolbox.setSelectedItem(firstItem);
172+
isHandled = true;
173+
} else isHandled = toolbox.selectNext();
170174
const selectedItem = toolbox.getSelectedItem();
171175
if (selectedItem) {
172176
Blockly.getFocusManager().focusNode(selectedItem);

src/navigation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ export class Navigation {
441441
if (cursor && (ignorePopUpDivs || !popUpDivsShowing)) {
442442
const curNode = cursor.getCurNode();
443443
if (curNode) {
444-
this.passiveFocusIndicator.show(curNode);
444+
// this.passiveFocusIndicator.show(curNode);
445445
}
446446
// It's initially null so this is a valid state despite the types.
447447
cursor.setCurNode(null);

0 commit comments

Comments
 (0)