ionic-team / ionic-v3

The repo for Ionic 3.x. For the latest version of Ionic, please see https://github.com/ionic-team/ionic
Other
129 stars 86 forks source link

Not been able to set focus to my <ion-input> while set page as root page ionic 3 ANDROID only #1143

Open bhandaribhumin opened 2 years ago

bhandaribhumin commented 2 years ago
 "@ionic/app-scripts": "3.2.3",
"@ionic-native/keyboard": "4.20.0",
  "cordova-plugin-ionic-keyboard": "2.2.0",

first time load page nothing happened also while click on <ion-input> keyboard not shown but when I click on outside of input or tap any other in page and than click on input it works.

https://user-images.githubusercontent.com/3336047/133235585-ed21d4e4-16be-4b89-89c5-0de0f949a563.mov

if (this.plt.is('android')) {
      setTimeout(() => {
        const element = this.renderer.selectRootElement(
          '#first > input'
        ) as HTMLTextAreaElement;
        element.focus();
        element.select();
      }, 200);

Also try all mention workaround but not works:

https://stackoverflow.com/questions/42693567/not-been-able-to-set-focus-to-my-ion-input-as-i-enter-the-page

There is similar issue :

https://github.com/ukhkxyz/ionic-v3/commit/43c1cc90d04007748ec073bd152899b9eb986763