Skip to content

Commit bbf30fa

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

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

plugins/field-multilineinput/src/field_multilineinput.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,11 @@ export class FieldMultilineInput extends Blockly.FieldTextInput {
163163
);
164164
}
165165
let textLines = this.getText();
166+
// TODO(google/blockly#8738): Use minimum-width setting mechanism
167+
// to be introduced in PR #9011.
166168
if (!textLines) {
167169
// Prevent the field from disappearing if empty.
168-
return Blockly.Field.NBSP;
170+
return '\u00A0'; // Non-breaking space.
169171
}
170172
const lines = textLines.split('\n');
171173
textLines = '';
@@ -182,7 +184,8 @@ export class FieldMultilineInput extends Blockly.FieldTextInput {
182184
}
183185
// Replace whitespace with non-breaking spaces so the text doesn't
184186
// collapse.
185-
text = text.replace(/\s/g, Blockly.Field.NBSP);
187+
// TODO(google/blockly#8738): Use Blockly.Field.NBSP.
188+
text = text.replace(/\s/g, '\u00A0'); // Non-breaking space.
186189

187190
textLines += text;
188191
if (i !== displayLinesNumber - 1) {

0 commit comments

Comments
 (0)