Chrome's default behavious is to hide the keyboard, when this one is open/shown and I click in any part of the screen. I want to achieve to prevent it from hidding if I click in a specific DOM element. Is that possible using JS?
window.onclick = function(event) {
var sendMsgBtn = document.getElementById("send-msg-icon");
if (event.target == sendMsgBtn) {
//what to do here
}
}
If you focus on a <input>
or <textarea>
element (it may be hidden) and then you click on it, the keyboard will not hide
window.onclick = function(event) {
var sendMsgBtn = document.getElementById("send-msg-icon");
if (event.target == sendMsgBtn) {
var input1 = document.getElementById("input1");
input1.focus();
input1.click();
}
}