Skip to content

Commit dbeff63

Browse files
authored
dont hide labels in expandable sections
1 parent 66edb3c commit dbeff63

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/addons/addons/editor-tweaks/userscript.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,19 @@ export default async function({ addon }) {
219219

220220
if (expandBtnSz === 0 && this.sourceBlock_) {
221221
const input = this.sourceBlock_.inputList.find(i => i.fieldRow.includes(this));
222-
if (input) input.setVisible(false);
222+
if (input) {
223+
// we dont want to hide labels or other fields:
224+
if (input.fieldRow.length > 2) {
225+
for (const field of input.fieldRow) {
226+
if (
227+
field instanceof Blockly.FieldExpandableAdd ||
228+
field instanceof Blockly.FieldExpandableRemove
229+
) field.setVisible(false);
230+
}
231+
} else {
232+
input.setVisible(false);
233+
}
234+
}
223235
}
224236

225237
const ratio = (Blockly.BlockSvg.FIELD_HEIGHT / 32) * expandBtnSz;

0 commit comments

Comments
 (0)