Unwanted new line in text input field

PennController for IBEX Forums Support Unwanted new line in text input field

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #8334

    Hello Jeremy,

    I have a task where participants need to write into a text input field what they see in a picture. They can either click on a button to go to the next item or they can press enter. If they press enter, the next time they reach this task there is an unwanted new line in the text input field. In the results it looks like this: “%0Aanswer”. Sometimes the %0A is at the end of the answer, not at the beginning. I don’t understand why this happens. (It does not happen when they use the button).
    Could you have a look at it please? Here is the link: https://farm.pcibex.net/r/SSBmRv/



    Hello Sabrina,

    Apparently there is a bug with the TextInput element whereby, if you release a keypress by the time the element is printed onto the page, that keypress is considered part of what you typed in the TextInput element. For some reason, the default 1-line limit on TextInput elements is overridden by that bug, which means that when, in your experiment, you validate a trial by pressing Enter (after selecting a value on the scale) by the time you release the keypress, the next trial’s TextInput has been printed and it therefore inserts a linebreak at the beginning

    You can work around that by adding a slight delay at the beginning of the trial so that the participant should have released the keypress by the time the TextInput element is created, eg 250ms: newTimer(250).start().wait()



    Hi Jeremy,
    that solved it, thank you very much!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.