on-screen-keyboard-detector icon indicating copy to clipboard operation
on-screen-keyboard-detector copied to clipboard

Fails on big sur 11.4 in safari

Open wildeyes opened this issue 4 years ago • 6 comments

image

wildeyes avatar Aug 01 '21 15:08 wildeyes

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.

semmel avatar Aug 11 '21 18:08 semmel

Got it. Should probably note that this could fail on unsupported browsers and that isSupported MUST be called in advance. Thanks!

wildeyes avatar Aug 12 '21 08:08 wildeyes

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(),	

mcslayer avatar Aug 18 '21 14:08 mcslayer

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

PeterKottas avatar Jul 13 '22 09:07 PeterKottas

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

chickoocoutinho avatar Nov 01 '22 07:11 chickoocoutinho

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

jzombie avatar Apr 08 '23 15:04 jzombie