mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-12-24 03:08:13 +03:00
d2af509eaf
Doesn't work some of the time.
16 lines
495 B
JavaScript
16 lines
495 B
JavaScript
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);
|
|
}
|
|
}
|