ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

bug: After keyboard open, the content height is wrong

Open andre-huehn opened this issue 10 years ago • 10 comments

Type: bug

Ionic Version: 1.x

Platform: android 5.1 webview

1.Create a screen without header and footer bars 2.Open the keyboard to enter something => The height of the content is calculated in the wrong fashion

Code wrong (Original Source code scrollViewNative.js): scrollViewOffsetHeight = Math.max(0, Math.min(self.__originalContainerHeight, self.__originalContainerHeight - (e.detail.keyboardHeight - 43)));

Code right (Altered Source Code): scrollViewOffsetHeight = Math.max(0, Math.min(self.__originalContainerHeight, self.__originalContainerHeight - (e.detail.keyboardHeight - ($scope.$hasHeader ? 43 : 0))));

This could of course also be solved in different ways, but this helped me solving the problem.

andre-huehn avatar Jan 25 '16 17:01 andre-huehn

This looks like the same issue as https://github.com/driftyco/ionic/issues/5800 but im not sure

jgw96 avatar Mar 14 '16 16:03 jgw96

Until now i also found out that the problem is still the calculation of the height of the scrollview, but you also need to set the App to fullscreen and set hideKeyboardAccessoryBar(true) .

My problem was fixed because we do not have a Fullscreen App anymore, therefore i can not provide a more detailed problem description.

Regards, Andre

andre-huehn avatar Mar 14 '16 16:03 andre-huehn

Sounds like it's fixed now, and the upcoming release has a few more fixes. Thanks.

adamdbradley avatar Apr 12 '16 03:04 adamdbradley

@adamdbradley Could you reopen the issue? The problem is still here in v1.3. The following formula should probably solve the issue and eliminate the magical number 43.

scrollViewOffsetHeight = Math.max(0, Math.min(self.__originalContainerHeight, self.__originalContainerHeight - (e.detail.keyboardHeight - (window.innerHeight - rect.bottom))));

m1r4ge avatar Jul 19 '16 21:07 m1r4ge

@jgw96 @adamdbradley The bug is still relevant. Check this fix.

dmitriie-brd avatar Jul 21 '16 07:07 dmitriie-brd

Hello, thanks for using Ionic! This has been fixed in the latest Ionic 1 release 🎉

jgw96 avatar Oct 27 '16 19:10 jgw96

@jgw96 No, it's another bug. And it is still there

dmitriie-brd avatar Dec 08 '16 12:12 dmitriie-brd

@jgw96 Any update for this issue yet ? Still having this issue in Ionic version 1.3.3

Wvhf avatar Jun 27 '17 09:06 Wvhf

Ionic v1 lives here now: https://github.com/ionic-team/ionic-v1

janpio avatar Jun 27 '17 11:06 janpio

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

ionitron-bot[bot] avatar Sep 02 '18 15:09 ionitron-bot[bot]