The editable box only work in latter routine

OS (e.g. Win10): Win8.1
PsychoPy version (e.g. 1.84.x): v2021.2.3
What are you trying to achieve?:

I have “Actual” and “Ideal” routine and each one has two textboxes for participants to response (the image shows one of the routine looks like), but when I run the experiment, the two textboxes in “Actual” does not responsive and I can’t key in any words, but the other two textboxes in “Ideal” can.
it’s weird because I found many questions asked before are about the first one could work and the second one can’t, but in my case it’s the opposite. Does anyone have ideas about how to solve this problem? Thanks!

What did you try to make it work?:
I have tried the PosWrite.refresh() solution and it didn’t work. I got a “AttributeError: ‘TextBox2’ object has no attribute ‘refresh’.” error.
And I have tried to disable the two textboxes in “Ideal” routine and the “Actual” textboxes become normal, so I think it’s the “Ideal” textboxes affect the “Actual” textboxes?

.refresh() is an online only method, so set your code component type to “JS”.

The textbox should be ok locally without need for this however. Is the problem you are experiencing locally or when running online?

Hi Becca,
I’m running it locally, and I have tried to prevent this problem by using loops(because the components in these two routines are the same)

oh funky ok that does sound like a bug that is a new one to me!!

I tried to replicate by having two routines each with two textbox components and a routine separating them that has it’s own loop. But this seems to run OK locally for me - please could you give this a try and confirm if it works your side too?
multi_textbox_debug.psyexp (24.2 KB)


Sorry, but I encounter the same problem on my side, can’t type words in first two textboxes but can in the second two textboxes.

OK. In that case it seems to be something system specific - so that we can confirm - do you have access to a different device to try it on? I am running windows 10 and I notice that you are running windows 8 - so I think that should be the only diff between set ups at the moment

I have tried to use a Win10 system to run the experiment but it’s the same result.
To make my problem more clear, I have uploaded a video on Youtube about the problem I encounter when trying to run the experiment, Hope this helps.

Hi There,

I think I see that my side on the first trial but the first trial only - please could you confirm if you press space to move forward that the following trials are ok?


Yes, the following trials are ok, only the first trial has problem.

OK this looks like a bug, so that we can suggest a workaround for you for now, what is the “loopType” of your “trials_2” loop? and does it take a spreadsheet in the conditions field?

My loopType is “Sequential” and it has a spreadsheet in the conditions field.
I had changed my flow and combined the “Actual” and “Ideal” into “Actual_Ideal” routine, so this problem does not occur for now.
But it would be appreciated that a workaround is provided for anyone who may encounter the same problem in the future. Thanks for the hardwork!


Ok so the good news is hopefully we can suggest a workaround for your experiment for now (although we should look further into this bug).

In your spreadsheet, please can you add an additional “buffer” trial to the first row (this trial won’t actually be presented it will only be there so that it hopefully initializes the textbox’s)

Then in your routines that exist inside your loop (Actual, Pos and Ideal) please can you add a code component, and in the begin routine tab write:

if trials_2.thisN == 0: # if this is the first "buffer" trial
    continueRoutine = False # skip this routine 
    trials.finished = True # skip the trials loop this once

Let us know if that does the trick


I got a NameError: name ‘trials’ is not defined
Should it be thisTrial_2.finished = True ?

To skip a loop that hasn’t yet started you need to use a variable nReps in the loop definition rather than trials.finished.

trials will be undefined in your Actual routine, but defined in your pos routine. You can’t use trials.finished = True to prevent the first iteration.

trials_2.finished will end your outer loop.

Hi wakecarter,
Yes, I have tried trials_2.finished and it ended my whole loop,
but thisTrial_2.finished seems to skip this trial (buffer trial) only.
Could you show how to use nReps to skip a loop? Thanks !

Try using trials.finished within the Pos routine only

(if your inner loop is called “trials”)

I had tried to skip the first trial by adding the buffer trial, but unfortunately it didn’t work on my side, the first two textboxes showed on the screen still didn’t work.

Hi Everyone,

For those following this thread I believe this should now be fixed if you update to the newest PsychoPy release! 2022.1.1