From d3e3a67a80395ead087c6b028d3083fe220bd02e Mon Sep 17 00:00:00 2001 From: Sotiri Bakagiannis Date: Tue, 15 Jun 2021 14:32:23 +0100 Subject: [PATCH 1/2] visual/TextBox: pass text value on to text input --- src/visual/TextBox.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/visual/TextBox.js b/src/visual/TextBox.js index 095de0b..b181b9e 100644 --- a/src/visual/TextBox.js +++ b/src/visual/TextBox.js @@ -319,6 +319,7 @@ export class TextBox extends util.mix(VisualStim).with(ColorMixin) padding: padding_px + 'px', multiline, + text: this._text, height: multiline ? (height_px - 2 * padding_px) + 'px' : undefined, width: (width_px - 2 * padding_px) + 'px' }, From e868f941f9d3dcbdba3d5d7915ae01654747b183 Mon Sep 17 00:00:00 2001 From: Sotiri Bakagiannis Date: Tue, 15 Jun 2021 14:33:07 +0100 Subject: [PATCH 2/2] visual/TextInput: access a text value, only disable text substitution when multiline --- src/visual/TextInput.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/visual/TextInput.js b/src/visual/TextInput.js index 1826ce6..f99d08b 100644 --- a/src/visual/TextInput.js +++ b/src/visual/TextInput.js @@ -22,6 +22,7 @@ export class TextInput extends PIXI.Container background: 'none', border: 'none', outline: 'none', + text: '', transformOrigin: '0 0', lineHeight: '1' }, @@ -56,7 +57,7 @@ export class TextInput extends PIXI.Container this._selection = [0, 0]; this._restrict_value = ''; this._createDOMInput(); - this.substituteText = false; + this.substituteText = !this._multiline; this._setState('DEFAULT'); }