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

Merge pull request #523 from lightest/CU-2nbq7bc_textboxes_focus_by_mouse

Fix for not being able to focus on TextBoxes;
This commit is contained in:
Alain Pitiot 2022-07-29 10:16:59 +02:00 committed by GitHub
commit f4da66eb9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -867,6 +867,9 @@ function DefaultBoxGenerator(styles)
let box = new PIXI.Graphics();
if (this._multiline) {
// When fill and alpha both 0 it for some reason ignores pointer events.
// But not when hitArea is set directly...
box.hitArea = new PIXI.Rectangle(0, 0, w, h);
box.interactive = !this._disabled;
box.on("pointerdown", () => {
this._dom_input.focus();