Answer the question
In order to leave comments, you need to log in
How do I stop the keyboard from popping up when I click on an item on my iPad?
There is a ReactJS application in which, when a date is selected, the calendar pops up, but the keyboard opens.
How and how to prevent the keyboard from appearing on tablets?
Answer the question
In order to leave comments, you need to log in
onClick or onFocus put this function
"use strict";
const HideKeyboard=()=> {
//this set timeout
setTimeout(function() {
var field = document.createElement('input');
field.setAttribute('type', 'text');
field.setAttribute('style', 'position:absolute; top: 0px; -webkit-transform: translateY(-9999px); -webkit-user-modify: read-write-plaintext-only; left:0px;');
document.body.appendChild(field);
field.onfocus = function(){
setTimeout(function() {
field.setAttribute('style', 'display:none;');
setTimeout(function() {
document.body.removeChild(field);
document.body.focus();
}, 14);
}, 200);
};
field.focus();
}, 50);
};
export default HideKeyboard;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question