mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-12-24 19:28:15 +03:00
17 lines
495 B
React
17 lines
495 B
React
|
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); // https://stackoverflow.com/a/23522755
|
||
|
|
||
|
export default function openOSK() {
|
||
|
if (isSafari) {
|
||
|
const fauxEl = document.createElement('input');
|
||
|
fauxEl.style.position = 'absolute';
|
||
|
fauxEl.style.top = '0';
|
||
|
fauxEl.style.left = '0';
|
||
|
fauxEl.style.opacity = '0';
|
||
|
document.body.appendChild(fauxEl);
|
||
|
fauxEl.focus();
|
||
|
setTimeout(() => {
|
||
|
document.body.removeChild(fauxEl);
|
||
|
}, 500);
|
||
|
}
|
||
|
}
|