Skip to content

Ionic 2 screen height dynamically changes while showing keyboard on device #5933

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

Closed
fedorinoGore opened this issue Mar 24, 2016 · 6 comments
Closed

Comments

@fedorinoGore
Copy link

Short description of the problem:

I accidentally discovered that screen vertical size changes after I'm clicking an input field in a from and device keyboard appears. After I closing keyboard - the height is still bigger than needed (and bigger than it was before) and I could scroll in vertical direction far beyond the visible area.

What behavior are you expecting?

It looks like that framework adds some height to the to make sure that keyboard will not overflow UI controls. But after hiding keyboard it should return to normal height, I believe...

Steps to reproduce:

  1. Create a form inside a
  2. Add some fileds
  3. Run on the device and tap on input field.
  4. Tap somewhere else to change focus
  5. Scroll in vertical direction to see that screen size dramatically changed...
<ion-content *ngIf="!auth.authenticated()" scroll="false">

    <div padding>
        <ion-segment [(ngModel)]="authType">
            <ion-segment-button value="login">
                Вход
            </ion-segment-button>
            <ion-segment-button value="signup">
                Регистрация
            </ion-segment-button>
        </ion-segment>
    </div>

    <div [ngSwitch]="authType">
        <form *ngSwitchWhen="'login'" #loginCreds="ngForm" (ngSubmit)="login(loginCreds.value)">
            <ion-item>
                <ion-label floating>Email</ion-label>
                <ion-input type="email" [(ng-model)]='user.username' value="{{user.username}}"></ion-input>
            </ion-item>
            <ion-item>
                <ion-label floating>Пароль</ion-label>
                <ion-input type="password"></ion-input>
            </ion-item>
            <div padding>
                <button block>Войти</button>
            </div>
        </form>

        <!--Or we could switch to register New user form-->
        <form *ngSwitchWhen="'signup'" #signupCreds="ngForm" (ngSubmit)="signup(signupCreds.value)">
            <ion-item>
                <ion-label floating>Email</ion-label>
                <ion-input type="email" ngControl="username"></ion-input>
            </ion-item>

            <ion-item>
                <ion-label floating>Пароль</ion-label>
                <ion-input type="password" ngControl="password"></ion-input>
            </ion-item>

            <ion-item>
                <ion-label floating>Повторите пароль</ion-label>
                <ion-input type="password" ngControl="repeatPassword"></ion-input>
            </ion-item>

            <div padding>
                <button block type="submit">Зарегистрироваться</button>
            </div>

        </form>
    </div>
    <!-- end of ngSwitch directive-->

</ion-content>

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
https://forum.ionicframework.com/t/ionic-2-ion-content-height-dynamically-changes-while-showing-keyboard-on-device/46360

Which Ionic Version? 2.x

Run ionic info from terminal/cmd prompt: (paste output below)
Cordova CLI: 6.0.0
Gulp version: CLI version 1.2.1
Gulp local: Local version 3.9.1
Ionic Version: 2.0.0-beta.3
Ionic CLI Version: 2.0.0-beta.19
Ionic App Lib Version: 2.0.0-beta.9
ios-deploy version: Not installed
ios-sim version: 5.0.6
OS: Mac OS X El Capitan
Node Version: v5.7.1
Xcode version: Xcode 7.3 Build version 7D175

@guillenotfound
Copy link
Contributor

This is related to my issue: #5800

@jgw96
Copy link
Contributor

jgw96 commented Mar 24, 2016

Hello! Thanks for opening an issue with us! As @ZiFFeL1992 pointed out this is related to his issue. I am going to consider it a duplicate and close this one. Thanks again!

@jgw96 jgw96 closed this as completed Mar 24, 2016
@EvanWillms
Copy link

Just tagging this as another #5432 report.

@rafaelwdantas
Copy link

+1

@sangeethanimapp
Copy link

hey hi, i wanted a card to moveup and reduce its size or moveup and should become blur on button click ,,,does anyone has some idea,,,please helpme out or send some references

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 2, 2018

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

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

No branches or pull requests

7 participants