Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 12 with iPhone landscape when keyboard opens then input box goes out of view area. #1045

Closed
stripathix opened this issue Dec 11, 2018 · 15 comments
Labels

Comments

@stripathix
Copy link

On clicking on any input field on the iPhone landscape page shift is wrong. input field goes out of view and even on some screens keyboard is hidden behind a keyboard.
See in attached screenshot how when I tap on a input field then that input field goes out of view area. I have also attached a video screencast.

49791214-f9cfe900-fd55-11e8-9134-9f890e4b3fb8

https://youtu.be/kveJ663r-oA

I am using Ionic 4 + Vue + Capacitor.

"@capacitor/android": "1.0.0-beta.11",
		"@capacitor/cli": "1.0.0-beta.11",
		"@capacitor/core": "1.0.0-beta.11",
		"@capacitor/ios": "1.0.0-beta.11",
"@ionic/core": "4.0.0-beta.17",
		"@ionic/vue": "0.0.1",
<div class="ion-page">
  <ion-header>
    <ion-toolbar color="dark">
      <ion-buttons slot="start">
        <menu-button></menu-button>
      </ion-buttons>
      <ion-title>
        Developer
      </ion-title>
    </ion-toolbar>
  </ion-header>
  <ion-content class="hasfooter">
    <ion-list>
      <ion-item>
        <ion-label position="stacked">Service Host</ion-label>
        <ion-input :value="serviceHost" @ionInput="serviceHost = $event.target.value" placeholder="Enter Service Host"></ion-input>
      </ion-item>
      <ion-item>
        <ion-label position="stacked">Test1</ion-label>
        <ion-input :value="serviceHost" @ionInput="serviceHost = $event.target.value" placeholder="Enter Service Host"></ion-input>
      </ion-item>
      <ion-item>
        <ion-label position="stacked">Test2</ion-label>
        <ion-input :value="serviceHost" @ionInput="serviceHost = $event.target.value" placeholder="Enter Service Host"></ion-input>
      </ion-item>
      <ion-item>
        <ion-label position="stacked">test3</ion-label>
        <ion-input :value="serviceHost" @ionInput="serviceHost = $event.target.value" placeholder="Enter Service Host"></ion-input>
      </ion-item>
    
    </ion-list>
  </ion-content>
  <ion-footer>
    <ion-toolbar color="dark">
    </ion-toolbar>
  </ion-footer>
</div>

Initially, I reported it to ionic but they pointed this as an issue related to keyboard (Capacitor or Cordova).

@stripathix
Copy link
Author

Hi, @jcesarmobile is this a known issue. I looked into this issue (#814) but it is different from what I am experiencing.

@stripathix
Copy link
Author

Hi @jcesarmobile , Could you please look into this.

@stripathix
Copy link
Author

Any update on this.

@boozedog
Copy link

I'm also interested in a solution for this please!!

@sneko
Copy link

sneko commented Jan 13, 2019

#1119 maybe it can help you. Note this PR is not released for now ---> modify the file directly to try it.

@jcesarmobile
Copy link
Member

#1119 is merged.
It fixes the problem for me using ionic and body resize options:

"plugins": {
      "Keyboard": {
          "resize": "ionic"
      }
  }

@stripathix can you verify and close if it fixes the problem?

@stripathix
Copy link
Author

@jcesarmobile where to add below config?

"plugins": {
      "Keyboard": {
          "resize": "ionic"
      }
  }

I have updated node_modules below file with latest code from: https://github.com/ionic-team/capacitor/pull/1119/files

@capacitor/ios/ios/Capacitor/Capacitor/Plugins/Keyboard.m

@sneko
Copy link

sneko commented Jan 24, 2019

@stripathix in your capacitor.config.json file. You should have something default like:

  "plugins": {
    "SplashScreen": {
      "launchAutoHide": false
    }
  }

@stripathix
Copy link
Author

Thanks, @sneko. Like this?

{
  "appId": "net.***.****",
  "appName": "****",
  "bundledWebRuntime": false,
  "webDir": "dist",
  "ios": {
    "minVersion": "11"
  },
  "plugins": {
    "SplashScreen": {
      "launchAutoHide": false
    },
    "Keyboard": {
          "resize": "ionic"
    }
  }
}

@sneko
Copy link

sneko commented Jan 24, 2019 via email

@stripathix
Copy link
Author

@jcesarmobile I am still getting same issue. On focusing a input field input field does get shifted and is hidden behind header.

In below screenshot see cursor next to Preferences header title. Input field shifts behind the header.

Note: It is in iPhone 8 Landscape mode.

screenshot 2019-01-24 at 5 30 59 pm

Steps I did

  1. In Capacitor.config.json I have following
{
  "appId": "net.******.******",
  "appName": "*******",
  "bundledWebRuntime": false,
  "webDir": "dist",
  "ios": {
    "minVersion": "11"
  },
  "plugins": {
    "SplashScreen": {
      "launchAutoHide": false
    },
    "Keyboard": {
      "resize": "ionic",
      "style": "dark"
    }
  }
}
  1. Replaced code of below file by latest code from Github master branch
/node_modules/@capacitor/ios/ios/Capacitor/Capacitor/Plugins/Keyboard.m

Used this file: https://github.com/ionic-team/capacitor/blob/master/ios/Capacitor/Capacitor/Plugins/Keyboard.m

  1. Then executed below commands
npx cap sync
npx cap copy

@jcesarmobile
Copy link
Member

I don't think it's the "same" issue now as it no longer is behind the keyboard, but behind the header, and only sometimes. I get the same behaviour on Cordova, so not entirely sure if now it's a Capacitor/Cordova Keyboard plugin bug or an Ionic bug

@stripathix
Copy link
Author

Any update on this?

@jcesarmobile
Copy link
Member

This is an Ionic bug since it also happens in Cordova apps

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 12, 2022

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 Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants