Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]:Textbox2 unexpectedly reset its text in the center in PsychJS (fine in PsychoPy) #590

Open
junfang219 opened this issue Nov 27, 2023 · 0 comments

Comments

@junfang219
Copy link

PsychoPy Version

2023.2.3

What OS are your PsychoPy running on?

macOS Silicon

Bug Description

The textbox border and text changed the color when I have the below code in EACH FRAME, but the text itself was replaced to the center, which is unexpected.

if (textbox.contains(mouse)) {
textbox.color = "red";
textbox.borderColor = "red";
} else {
textbox.color = "black";
textbox.borderColor = "black";
}

The detailed description is posted in the forum, please see https://discourse.psychopy.org/t/textbox2-unexpectedly-reset-its-text-in-the-center-in-psychjs-fine-in-psychopy/37700/1

Expected Behaviour

The text won't change its position when textbox.color and textbox.borderColor gets assigned a new color.

Steps to Reproduce

  1. creat a textbox with text in it and set it to a new position (e.g., not (0,0)).
  2. in each frame, let the textbox watch for mouse hover. The textbox.color = red when the mouse is over it
  3. the text color changed but the text in the box will be replaced to the center.
    ...

Additional context

No response

@peircej peircej transferred this issue from psychopy/psychopy Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant