2017-05-09 80 views
1

我公司開發的離子以下登錄頁面: 離子形式不向上滑動時,鍵盤重疊輸入

<form name="login_form" class="form-container" novalidate> 

    <div class="byf-logo"> 
    <img src="img/logo-text-clear-transparent.png" /> 
    </div> 

    <div class="list list-inset byf-login-form"> 
    <label class="item item-input"> 
     <img src="img/icons/person.png" alt=""> 
     <input type="email" placeholder="Email" ng-model="user.email" required> 
    </label> 
    <label class="item item-input"> 
     <img src="img/icons/locker.png" alt=""> 
     <input type="password" placeholder="Password" ng-model="user.password" required> 
    </label> 
    <button class="button button-block button-assertive" ng-click="login(user)" ng-disabled="login_form.$invalid">CONNEXION</button> 
    </div> 



</form> 

<div ng-show="error"> 
    <p class="message error"><i>{{error}}</i></p> 
</div> 

我期望形式來滑了一點時所輸入的密碼(第二個輸入)因爲鍵盤與它重疊: enter image description here

它在另一個頁面中完美工作,無需編寫任何特定的代碼所以我想這是默認行爲。

任何想法爲什麼它不在這裏滑動?

回答

1

我有同樣的問題,我可以得到它的工作的唯一方法是如下

this.keyboard.onKeyboardShow().subscribe(e => { 

console.log('Keyboard height is: ' + e.keyboardHeight); 

jQuery('body').animate({ 'marginTop': - e.keyboardHeight + 'px' }, 200); 

}); 

this.keyboard.onKeyboardHide().subscribe(e => { 

jQuery('body').animate({ 'marginTop': 0 + 'px' }, 200); 

});