Skip to content

Commit ed8b40f

Browse files
committed
fix(FieldMultilineInput): Use string literal instead of Field.NBSP
Workaround for removal of that constant in RaspberryPiFoundation/blockly#8738.
1 parent 996ef37 commit ed8b40f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

plugins/field-multilineinput/src/field_multilineinput.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ export class FieldMultilineInput extends Blockly.FieldTextInput {
165165
let textLines = this.getText();
166166
if (!textLines) {
167167
// Prevent the field from disappearing if empty.
168-
return Blockly.Field.NBSP;
168+
// TODO(google/blockly#8738): Use Blockly.Field.NBSP if it is restored.
169+
return '\u00A0'; // Non-breaking space.
169170
}
170171
const lines = textLines.split('\n');
171172
textLines = '';
@@ -182,7 +183,8 @@ export class FieldMultilineInput extends Blockly.FieldTextInput {
182183
}
183184
// Replace whitespace with non-breaking spaces so the text doesn't
184185
// collapse.
185-
text = text.replace(/\s/g, Blockly.Field.NBSP);
186+
// TODO(google/blockly#8738): Use Blockly.Field.NBSP if it is restored.
187+
text = text.replace(/\s/g, '\u00A0'); // Non-breaking space.
186188

187189
textLines += text;
188190
if (i !== displayLinesNumber - 1) {

0 commit comments

Comments
 (0)