on-screen-keyboard-detector
on-screen-keyboard-detector copied to clipboard
Fails on big sur 11.4 in safari
Please note that this project does not cover desktop browsers since they don't feature that kind of on-screen keyboards. Detection of that browsers is done by isSupported() of this project.
Could you check "ontouchend" in document in that browser?
If false isSupported() should also return false as rightly so for desktop browsers.
Got it. Should probably note that this could fail on unsupported browsers and that isSupported MUST be called in advance. Thanks!
Hello. Maybe, we can use fallback for desktop or old version of mobile browser
getNewOrientationType = () => screen.orientation.type.startsWith('portrait') ? 'portrait' : 'landscape',
getOldOrientationType = () => Math.abs(Number(window.orientation)) === 90 ? 'landscape' : 'portrait',
getScreenOrientationType = () =>
screen.orientation && screen.orientation.type ? getNewOrientationType() : getOldOrientationType(),
I have seen this error too. It falsely reported isSupported to be true. Solved by
if (isSupported() && window?.screen?.orientation?.type)
I don't know the exact device as this happened on a client device
I don't know the exact device as this happened on a client device
I have also encountered this issue.
Occurs on Ipads. IOS version 14 - 15
Screen orientation doesn't appear to be supported on iOS Safari less than 16.4, which was just released a few weeks ago. That's probably the cause of this issue:
https://caniuse.com/screen-orientation