Skip to content

Commit 2f33035

Browse files
committed
Respond to comments
1 parent ffc9554 commit 2f33035

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/actions/enter.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ export class EnterAction {
115115
const curNode = cursor?.getCurNode();
116116
if (!curNode) return false;
117117
if (curNode instanceof Field && !curNode.isClickable()) return false;
118+
if (
119+
curNode instanceof RenderedConnection ||
120+
curNode instanceof WorkspaceSvg
121+
) {
122+
return !workspace.isReadOnly();
123+
}
118124
// Returning true is sometimes incorrect for icons, but there's no API to check.
119125
return true;
120126
}
@@ -131,19 +137,23 @@ export class EnterAction {
131137
if (!curNode) return false;
132138
if (curNode instanceof Field) {
133139
curNode.showEditor();
140+
return true;
134141
} else if (curNode instanceof BlockSvg) {
135142
if (!this.tryShowFullBlockFieldEditor(curNode)) {
136143
showHelpHint(workspace);
137144
}
145+
return true;
138146
} else if (
139147
curNode instanceof RenderedConnection ||
140148
curNode instanceof WorkspaceSvg
141149
) {
142150
this.navigation.openToolboxOrFlyout(workspace);
151+
return true;
143152
} else if (curNode instanceof icons.Icon) {
144153
curNode.onClick();
154+
return true;
145155
}
146-
return true;
156+
return false;
147157
}
148158

149159
/**

0 commit comments

Comments
 (0)