Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ This plugin has been designed to work seamlessly with `cordova-plugin-ionic-webv
- https://github.com/ionic-team/cordova-plugin-ionic-webview
- https://ionicframework.com/docs/wkwebview/

## Purpose of this fork
- Fix screen not scrolled when keyboard displayed on IOS 17 beta

## Installation

```
cordova plugin add cordova-plugin-ionic-keyboard --save
cordova plugin add https://github.com/powowbox/cordova-plugin-ionic-keyboard.git --save --noregistery
```

## Preferences
Expand Down
8 changes: 8 additions & 0 deletions src/ios/CDVIonicKeyboard.m
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ - (void)onKeyboardWillShow:(NSNotification *)note
}
CGRect rect = [[note.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
double height = rect.size.height;
if ( height < 100 ) {
// SPI 07/07/23 fix for ios 17 beta. The callback trigger a first time with height 44 => the page is not scrolled correctly
return;
}

if (self.isWK) {
double duration = [[note.userInfo valueForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue];
Expand All @@ -172,6 +176,10 @@ - (void)onKeyboardDidShow:(NSNotification *)note
{
CGRect rect = [[note.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
double height = rect.size.height;
if ( height < 100 ) {
// SPI 07/07/23 fix for ios 17 beta. The callback trigger a first time with height 44 => the page is not scrolled correctly
return;
}

if (self.isWK) {
[self resetScrollView];
Expand Down