How to prevent input from losing focus on other element click?


#1

Hello,

How can I prevent an input element from losing focus (and therefore closing the input keyboard on mobile devices) when another element is pressed?

I am building a chat module in my app and it’s annoying that every time the user pushes the send button the keyboard hides and the input looses focus.

I’ve already tried to use the “focus()” and “click()” function (on the input element) when the user pushes the send button but it doesn’t work.

Thanks,
J.