PennController for IBEX › Forums › Troubleshooting › Reply To: Troubleshooting
January 17, 2023 at 2:53 pm
#9848
Jeremy
Keymaster
Hi Yev,
PennController always gives focus to the most recently added TextInput element. If at one point in your trial, you want focus to go to a given TextInput element, you can use the Function element to execute some javascript code during runtime:
newTrial( newTextInput("first").print() , newTextInput("second").print() , newFunction( ()=>document.querySelector(".PennController-first").focus() ).call() , newButton("Next").print().wait() )
Jeremy