mirror of
https://github.com/psychopy/psychojs.git
synced 2025-05-12 08:38:10 +00:00
visual/TextBox+TextInput: skip event listeners for ButtonStim
This commit is contained in:
parent
05eb0aabf0
commit
61e41553d3
@ -404,6 +404,13 @@ export class TextBox extends util.mix(VisualStim).with(ColorMixin)
|
||||
this._pixi.destroy(true);
|
||||
}
|
||||
this._pixi = new TextInput(this._getTextInputOptions());
|
||||
|
||||
// listeners required for regular textboxes, but may cause problems with button stimuli
|
||||
if (!(this instanceof ButtonStim))
|
||||
{
|
||||
this._pixi._addListeners();
|
||||
}
|
||||
|
||||
// check if other TextBox instances are already in focus
|
||||
const { _drawList = [] } = this.psychoJS.window;
|
||||
const otherTextBoxWithFocus = _drawList.some(item => item instanceof TextBox && item._pixi && item._pixi._hasFocus());
|
||||
|
@ -56,7 +56,6 @@ export class TextInput extends PIXI.Container
|
||||
this._createDOMInput();
|
||||
this.substituteText = true;
|
||||
this._setState('DEFAULT');
|
||||
this._addListeners();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user