this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Hacky way to show on-screen keyboard

Doesn't work some of the time.

+18
+2
src/components/compose-button.jsx
··· 1 1 import { useHotkeys } from 'react-hotkeys-hook'; 2 2 3 3 import openCompose from '../utils/open-compose'; 4 + import openOSK from '../utils/open-osk'; 4 5 import states from '../utils/states'; 5 6 6 7 import Icon from './icon'; ··· 14 15 states.showCompose = true; 15 16 } 16 17 } else { 18 + openOSK(); 17 19 states.showCompose = true; 18 20 } 19 21 }
+16
src/utils/open-osk.jsx
··· 1 + const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); // https://stackoverflow.com/a/23522755 2 + 3 + export default function openOSK() { 4 + if (isSafari) { 5 + const fauxEl = document.createElement('input'); 6 + fauxEl.style.position = 'absolute'; 7 + fauxEl.style.top = '0'; 8 + fauxEl.style.left = '0'; 9 + fauxEl.style.opacity = '0'; 10 + document.body.appendChild(fauxEl); 11 + fauxEl.focus(); 12 + setTimeout(() => { 13 + document.body.removeChild(fauxEl); 14 + }, 500); 15 + } 16 + }