ionic-team / cordova-plugin-ionic-keyboard

Keyboard Plugin for Cordova
Other
192 stars 177 forks source link

Ionic 4 - Keyboard covers the input field inside a form #110

Closed Nikhil-Daffodil closed 4 years ago

Nikhil-Daffodil commented 4 years ago

In Android the keyboard covers the input field inside a form, thus making me unable to see what has been written unless I close the keyboard.

I'm not developing iOS, so can't say about that

Thanks in advance

jcesarmobile commented 4 years ago

can you provide a sample app?

Nikhil-Daffodil commented 4 years ago

https://drive.google.com/folderview?id=15gEFk_CbkhPbRin2COwJuR9L8laxjYtR

Check out sign up page for more clarification

jcesarmobile commented 4 years ago

I'm asking about the code, not the apk

Nikhil-Daffodil commented 4 years ago

app.module.ts `import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { RouteReuseStrategy } from '@angular/router';

import { IonicModule, IonicRouteStrategy } from '@ionic/angular'; import { SplashScreen } from '@ionic-native/splash-screen/ngx'; import { StatusBar } from '@ionic-native/status-bar/ngx';

import { AppComponent } from './app.component'; import { AppRoutingModule } from './app-routing.module'; import { Pedometer } from '@ionic-native/pedometer/ngx'; import { Stepcounter } from '@ionic-native/stepcounter/ngx'; import { NgCircleProgressModule } from 'ng-circle-progress'; import { Network } from '@ionic-native/network/ngx'; import { StorageProvider } from './providers/storage/storage.service'; import { IonicStorageModule } from '@ionic/storage'; import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; import { Keyboard } from '@ionic-native/keyboard/ngx'; import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http'; import { TokenInterceptor } from './providers/service/token.interceptor'; import { ServiceProvider } from './providers/service/service.service'; import { SetReminderComponent } from './components/set-reminder/set-reminder.component'; import { ReactiveFormsModule } from '@angular/forms'; import { ReminderDetailsComponent } from './components/reminder-details/reminder-details.component'; import { TextToSpeech } from '@ionic-native/text-to-speech/ngx'; import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; import { LocalNotifications } from '@ionic-native/local-notifications/ngx'; import { Push } from '@ionic-native/push/ngx'; import { SocialSharing } from '@ionic-native/social-sharing/ngx';

@NgModule({ declarations: [ AppComponent, SetReminderComponent, ReminderDetailsComponent, ], entryComponents: [ SetReminderComponent, ReminderDetailsComponent ], imports: [ BrowserModule, IonicModule.forRoot(), IonicStorageModule.forRoot(), AppRoutingModule, // Specify ng-circle-progress as an import NgCircleProgressModule.forRoot({ // set defaults here radius: 100, outerStrokeWidth: 16, innerStrokeWidth: 8, outerStrokeColor: "#78C000", innerStrokeColor: "#C7E596", animationDuration: 300, }), HttpClientModule, ReactiveFormsModule, BrowserAnimationsModule ], providers: [ StatusBar, SplashScreen, Pedometer, Stepcounter, Network, StorageProvider, InAppBrowser, Keyboard, { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }, { provide: HTTP_INTERCEPTORS, useClass: TokenInterceptor, multi: true }, ServiceProvider, TextToSpeech, LocalNotifications, Push, SocialSharing ], bootstrap: [AppComponent] }) export class AppModule { } `

app.component.ts `import { Component, ViewChild } from '@angular/core';

import { Platform, NavController, Events, IonRouterOutlet, AlertController, MenuController, LoadingController } from '@ionic/angular'; import { SplashScreen } from '@ionic-native/splash-screen/ngx'; import { StatusBar } from '@ionic-native/status-bar/ngx'; import { Config } from './app.config'; import { Keyboard } from '@ionic-native/keyboard/ngx'; import { StorageProvider } from './providers/storage/storage.service'; import { LoginService } from './providers/login/login.service'; import { CommonPopoverService } from './providers/common-popover/common-popover.service'; import { Push, PushObject, PushOptions, } from '@ionic-native/push/ngx'; import { PushNotificationService } from './providers/push-notification/push-notification.service';

@Component({ selector: 'app-root', templateUrl: 'app.component.html' }) export class AppComponent { userName: string; public appPages = Config; exitAlert: any; logoutLoading: any; deviceId: any; @ViewChild(IonRouterOutlet) routerOutlet: IonRouterOutlet;

constructor( private platform: Platform, private splashScreen: SplashScreen, private statusBar: StatusBar, private navCtrl: NavController, private events: Events, private keyboard: Keyboard, private alert: AlertController, private keystore: StorageProvider, private menu: MenuController, private loginService: LoginService, private loader: LoadingController, private commonPopover: CommonPopoverService, private push: Push, private pushService: PushNotificationService ) { this.initializeApp(); }

/**

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1) Cordova Platforms : android 7.1.4 Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.0.1, (and 14 other plugins)

Utility:

cordova-res : not installed native-run : 0.2.8

System:

Android SDK Tools : 26.1.1 (/Users/daffolapmac-07/Library/Android/sdk/) NodeJS : v8.11.3 (/usr/local/bin/node) npm : 5.6.0 OS : macOS Mojave`

login.page.html `

Nikhil-Daffodil commented 4 years ago

2019-08-29-20-21-32 2019-08-29-20-19-01 2019-08-29-20-19-51 2019-08-29-20-17-47

MohanKrishnaBatchu commented 4 years ago

If you installed status bar plugin(https://ionicframework.com/docs/native/status-bar) that's fine otherwise install the plugin, after the installation open your app.component.ts, go to your constructor add below line,

this.statusBar.overlaysWebView(false);

That's it, hope it will solve your toolbar truncating problem.

Thanks, Mohan Batchu.

Nikhil-Daffodil commented 4 years ago

@MohanKrishnaBatchu Thanks man, it works. You save my day

jcesarmobile commented 4 years ago

That's why I was asking for a sample app, other plugins like status-bar plugin can cause conflicts like in this case.

Next release of cordova-plugin-ionic-keyboard (2.2.0) will have a new preference (<preference name="resizeOnFullScreen" value="true" />) that can probably help with your issue you don' have to set overlaysWebView to false.

Nikhil-Daffodil commented 4 years ago

@jcesarmobile that will be great if we get it in the next release. Thanks for help

Nikhil-Daffodil commented 4 years ago

If you installed status bar plugin(https://ionicframework.com/docs/native/status-bar) that's fine otherwise install the plugin, after the installation open your app.component.ts, go to your constructor add below line,

this.statusBar.overlaysWebView(false);

That's it, hope it will solve your toolbar truncating problem.

Thanks, Mohan Batchu.

@MohanKrishnaBatchu I faced another issue, the input field doesn't come up at first. It hides under the keyboard and when I type it comes up

poimsm commented 4 years ago

I uninstalled status bar and tested my app but the ion-content didn't scroll and the input field was covered by the keyboard.. then I installed again status bar and added

this.statusBar.overlaysWebView(false);

in the app.component.ts but the result was the same.. it didn't push ion-content and it hides the input

poimsm commented 4 years ago

I just tested

//<preference name="resizeOnFullScreen" value="true"

with the latest commit, it works partially: when first touch on input the input remain hidden until I start writing, after that all my ion-footers hide like 30%

ElfatniAnass commented 4 years ago

@poimsms do you found any solution to resolve this please ?

poimsm commented 4 years ago

Yes, I downgrade the keyboard plugin and that solve muy problem

El vie., 28 de febrero de 2020 1:18 p. m., ElfatniAnass < notifications@github.com> escribió:

@poimsms https://github.com/poimsms do you found any solution to resolve this please ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ionic-team/cordova-plugin-ionic-keyboard/issues/110?email_source=notifications&email_token=AJGDWOHV4LNHZBO7PEL7QN3RFE2M3A5CNFSM4IR6EZ2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENJCHKA#issuecomment-592585640, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJGDWOEVYBNVZO6ASGT5PVDRFE2M3ANCNFSM4IR6EZ2A .

ElfatniAnass commented 4 years ago

@poimsms thanks for your replay i'm facing the same problem but i'm juste adding Keyboard offset of the content that's solve the problem

smiledev1230 commented 4 years ago

@ElfatniAnass Where did you add the Keyboard offset of the content?

ElfatniAnass commented 4 years ago

@smiledev1230 in your global scss file add Keyboard offset ex :

ion-content.class-content { --keyboard-offset: 10rem !important; }