Skip to content

Commit 4ddbac6

Browse files
fix: prevent enter on icons moving to next icon/field (#638)
The in() behaviour relied on here only works for MutatorIcons. See icon_navigation_policy.ts in core. That might change over time, but there will still be some icons for which this isn't appropriate. Prior to this change enter on a comment icon or a MakeCode debug breakpoint icon inexplicably moves the cursor to the next field/icon.
1 parent ed692a8 commit 4ddbac6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/actions/enter.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,13 @@ export class EnterAction {
159159
// opening a bubble of some sort. We then need to wait for the bubble to
160160
// appear before attempting to navigate into it.
161161
curNode.onClick();
162-
renderManagement.finishQueuedRenders().then(() => {
163-
cursor?.in();
164-
});
162+
// This currently only works for MutatorIcons.
163+
// See icon_navigation_policy.
164+
if (curNode instanceof icons.MutatorIcon) {
165+
renderManagement.finishQueuedRenders().then(() => {
166+
cursor?.in();
167+
});
168+
}
165169
return true;
166170
}
167171
return false;

0 commit comments

Comments
 (0)