1
0
mirror of https://github.com/psychopy/psychojs.git synced 2025-05-12 16:48:10 +00:00

Merge pull request #402 from thewhodidthis/bf#395--text-input

visual/TextBox/TextInput: only disable text substitution when multiline
This commit is contained in:
Alain Pitiot 2021-06-15 15:35:25 +02:00 committed by GitHub
commit 6cd6135ce7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -319,6 +319,7 @@ export class TextBox extends util.mix(VisualStim).with(ColorMixin)
padding: padding_px + 'px', padding: padding_px + 'px',
multiline, multiline,
text: this._text,
height: multiline ? (height_px - 2 * padding_px) + 'px' : undefined, height: multiline ? (height_px - 2 * padding_px) + 'px' : undefined,
width: (width_px - 2 * padding_px) + 'px' width: (width_px - 2 * padding_px) + 'px'
}, },

View File

@ -22,6 +22,7 @@ export class TextInput extends PIXI.Container
background: 'none', background: 'none',
border: 'none', border: 'none',
outline: 'none', outline: 'none',
text: '',
transformOrigin: '0 0', transformOrigin: '0 0',
lineHeight: '1' lineHeight: '1'
}, },
@ -56,7 +57,7 @@ export class TextInput extends PIXI.Container
this._selection = [0, 0]; this._selection = [0, 0];
this._restrict_value = ''; this._restrict_value = '';
this._createDOMInput(); this._createDOMInput();
this.substituteText = false; this.substituteText = !this._multiline;
this._setState('DEFAULT'); this._setState('DEFAULT');
} }