Important: Please read the Qt Code of Conduct -

Keep focus on TextField after clearing

  • Hi everyone,

    Using a simple TextField, I properly get the focus when I try to write inside the field. But once I clear the texts programmatically, like doing textField.text = "" or textField.clear(), I lose the focus and I have to manually do textField.focus in order to regain the focus.

    The use case is a simple Chat input text field, which needs to be cleared once the text has been submitted so the user can continue to add more texts.

    Of course, the problem with that is this: the Android keyboard disappears and immediately appears again. This is visibly annoying and looks unprofessional. How can I solve this?


Log in to reply