Textbox does not show a flashing cursor

It was not a problem locally on psychopy builder, but once I run the exported psychojs on Pavlovia, the input textbox does not show a flashing cursor which typically should.


However, if I click the textbox with my mouse, it shows

Also is there a way to not initialize the textbox with empty space? Right now I have to initialize the textbox with some content (in my case a space) otherwise it will give me error saying None object cannot blablablabla. Is there a better work-around?

My self paced reading demo includes an editable text box with focus.

2 Likes

Thanks! adding textbox._pixi.focus() to the js file worked!!

I was so hoping this solution would work for me but it doesn’t.

It is totally strange, @wakecarter, your demo runs fine for me, but when I use the textbox._pixi.focus() command in update every frame in my own experiment, I get an error of 'Cannot read property ‘focus’ of undefined.

There are no typos in there, I don’t know what else to try anymore to be honest. Any more thoughts would be much appreciated.

Is your text box called textbox?

No but I am using the correct spelling of my textbox name. I have tried also just calling it textbox but the result is the same.Screenshot 2021-08-26 at 14.46.42

Please could you confirm the order. Where is the catchTxtbox component in relation to the focus command? Which tab is the focus command in?

The focus command is in the ‘every frame’ tab just like in your script. The code component was in the same routine as the catchTxtbox component if that’s what you mean by order but see the attached screenshot (catchTxtbox is greyed out as I have opted for another final solution in the end). I am not a Psychopy/Pavlovia beginner and I think I have checked all the basic reasons why things might not work and also checked the forum carefully for other solutions; e.g.I tried not using the focus command and not using a mouse click to end the routine and instead using the keyboard (as this was suggested someone in a different thread) but the result was the same. I also ran the script in compatibility mode one version earlier but to no avail.

I have reverted back to the old code-based way of having text entry as nothing was working. Now it’s all good without a problem. Thanks for trying to help.