Iraklis Bekiaris
Iraklis Bekiaris

Reputation: 1221

Ionic 4, Keyboard moves content

I have this html in my ionic project

<ion-header>
  <ion-toolbar mode="ios">
    <ion-searchbar>
    </ion-searchbar>
    <ion-title>    
    </ion-title>
  </ion-toolbar>
  <ion-list class="m-0-p-0">
    <ion-item *ngFor="let user of users">
    </ion-item>
  </ion-list>
</ion-header>

<ion-content scrollY="false">
  <ion-grid>
    <ion-row class="centered">
           ....
    </ion-row>
  </ion-grid>
</ion-content>

this is my centered class:

.centered{
    position:fixed ;
    width:100%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

So, when i go into the searchbar, when the keyboard is showing up, the content of the center is moving up. I searched on the web for solutions but it seems that things have changed in ionic 4 and i cannot do: Keyboard.disableScroll(true).. or can I?

Upvotes: 2

Views: 276

Answers (0)

Related Questions