Hi everyone!
I am running a typing experiment on Pavlovia on PsychoPy version 2025.1.1 on phones and computers. I need to allow participants to use autocorrect and predictive text on their phones (ios/android).
- I’m using an Editable Textbox component
- On mobile devices, the keyboard opens correctly and the focus is maintained between routines
Problem: The prediction/suggestion bar (that suggests words above the keyboard) never appears. It looks like a basic keyboard without any suggestion features.
What I’ve tried
I’ve tried to manually inject HTML into a Code component to force the browser to recognise it as a standard field, but with no luck so far.
let inputs = document.getElementsByTagName('input');
for (let i = 0; i < inputs.length; i++) {
let el = inputs[i];
el.setAttribute('type', 'text');
el.setAttribute('inputmode', 'text');
el.setAttribute('autocorrect', 'on');
el.setAttribute('autocomplete', 'on');
el.setAttribute('spellcheck', 'true');
el.focus();
}
Questions:
- Does PsychoJS explicitly set inputmode or type to something that prevents the OS from showing the prediction bar?
- Is there another way to initialize a textbox so that the mobile browser will treat it as a “normal” field? (like a chat or email field)
Any insights would be appreciated, thank you!