Closed kotromeo closed 5 years ago
you're not accounting for pixel density of ~2 so it works out to around 760. I'm having the same issue, going to post a PR fixing this. The keyboard height is correct. What it's not doing is accounting for the 'safe' area inset of the bottom bar.
you're not accounting for pixel density of ~2 so it works out to around 760. I'm having the same issue, going to post a PR fixing this. The keyboard height is correct. What it's not doing is accounting for the 'safe' area inset of the bottom bar.
So problem on my side to determine 2x density or this problem on plugin side ?
The plugin return the size in points, and the size is correct. For iPhone X, 1 point = 3 pixels, that means its screen is 2436x1125 pixels, but 812x375 points.
If you have a viewport like this <meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
then your css values will also be considered as points, meaning your app resolution is really 812x375 pixels, not 2436x1125.
If for some reason you need the real pixels, you'll have to multiply the returned keyboard size by devicePixelRatio
(which is 3 for iPhone X).
Not sure where you get that size should be 760
Using event keyboardDidShow, getting keyboard height and it's about 379 but should be 760