ionic-team / cordova-plugin-ionic-keyboard

Keyboard Plugin for Cordova
Other
191 stars 177 forks source link

Capacitor: setResizeMode doesn't have any effect on iOS #147

Closed tobiasmuecksch closed 4 years ago

tobiasmuecksch commented 4 years ago

I'm trying to disable the viewport resizing.

import { Keyboard, KeyboardResizeMode } from '@ionic-native/keyboard/ngx';

@Component({
  selector: 'app-my',
  templateUrl: './my.page.html',
  styleUrls: ['./my.page.scss'],
})
class MyPage {
  constructor(
    private keyboard: Keyboard
  ){}

  ionViewWillEnter() {
    this.keyboard.setResizeMode(KeyboardResizeMode.Native);
  }
}

But it doesn't have any effect.

Am I doing something wrong?

Ionic Info:

Ionic:

   Ionic CLI                     : 6.6.0 (/Users/tmuecksch/.npm-global/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.0.7
   @angular-devkit/build-angular : 0.803.26
   @angular-devkit/schematics    : 8.3.26
   @angular/cli                  : 8.3.26
   @ionic/angular-toolkit        : 2.2.0

Capacitor:

   Capacitor CLI   : 2.0.1
   @capacitor/core : 2.0.1

Utility:

   cordova-res (update available: 0.12.0) : 0.11.0
   native-run (update available: 1.0.0)   : 0.3.0

System:

   NodeJS : v12.14.0 (/usr/local/bin/node)
   npm    : 6.13.4
   OS     : macOS Catalina

Plugin Version:

"@ionic-native/keyboard": "^5.23.0",
"cordova-plugin-ionic-keyboard": "^2.2.0",
tobiasmuecksch commented 4 years ago

I solved the problem by relying on Capacitor's Keyboard API instead of this plugin.

See: https://capacitor.ionicframework.com/docs/apis/keyboard