1
0
mirror of https://github.com/psychopy/psychojs.git synced 2025-05-11 16:18: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',
multiline,
text: this._text,
height: multiline ? (height_px - 2 * padding_px) + 'px' : undefined,
width: (width_px - 2 * padding_px) + 'px'
},

View File

@ -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');
}