Skip to content

bug: ion-slides with form inputs #5744

Closed

Description

@dylanvdmerwe

Short description of the problem:

On a device, when there is an ion-input, the ion-list scrolling behaviour does not work.

What behavior are you expecting?

On a device when inputting information, the keyboard opens up and the ion-list scrolls so that the keyboard does not cover the input fields. When the user closes the keyboard, the ion-list then scrolls back to it's original position.

If input is required in an ion-slides component (maybe as part of a wizard), the scrolling behaviour does not work as expected. The form's inputs move off the screen and the content cannot be seen. When the keyboard is closed, the content does not move back into focus.

The following simple input form works perfectly. The keyboard shows and the inputs are scrolled so that they are visible with the keyboard.

<ion-content class='register-page'>
            <ion-list>
                <img padding src='img/logo.png' style='max-width:100%'>
                <p>What course are you studying?</p>
                    <ion-item class='register-select'>
                        <ion-label hidden>Course</ion-label>
                        <ion-input placeholder='Enter your course' [ngModel]="courseInfo" (ngModelChange)="onCourseEntered($event)"></ion-input>
                    </ion-item>
                    <button clear (click)="continuePressed()" [disabled]='!courseInfoEntered'>Continue</button>
            </ion-list>
</ion-content>

If this exact same code was inside of an , the scrolling behaviour does not work.

A screenshot of all the content completely off screen with the keyboard open:
capture

Ionic Version: 2.x

Browser & Operating System: iOS / Android

Run ionic info from terminal/cmd prompt:

Cordova CLI: 6.0.0
Ionic Version: 2.0.0-beta.2
Ionic CLI Version: 2.0.0-beta.19
Ionic App Lib Version: 2.0.0-beta.9
OS:
Node Version: v5.7.0

Activity

  1. added this to the 2.0.0-beta.5 milestone on Apr 2, 2016
  2. EvanWillms commented on Apr 10, 2016

    @EvanWillms

    With ion-slides getting pushed around by the keyboard, this sounds very similar to #5571 and is likely another symptom of #5432.

  3. adamdbradley commented on Apr 12, 2016

    @adamdbradley
    Contributor

    Related: #6133

  4. 32 remaining items

  5. jgw96 commented on Dec 14, 2016

    @jgw96
    Contributor

    Hello all! I am going to close this issue as a duplicate of #9553 as they are caused by the same issue.

  6. LiveListMobile commented on Apr 30, 2017

    @LiveListMobile

    Just to chime in here on 04/30/17. I have am experiencing this issue as well. The inputs on the form jump around and/or disappear from the screen altogether making the slides completely unusable.

  7. juanpmarengo commented on Aug 3, 2017

    @juanpmarengo

    I am also experiencing this issue.

    Ionic info:

    cli packages: (/home/juanpmarengo/Projects/mydoc-ionic/node_modules)

    @ionic/cli-plugin-cordova       : 1.6.1
    @ionic/cli-plugin-ionic-angular : 1.4.1
    @ionic/cli-utils                : 1.7.0
    ionic (Ionic CLI)               : 3.7.0
    

    global packages:

    Cordova CLI : 7.0.1 
    

    local packages:

    @ionic/app-scripts : 2.1.0
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.5.3
    

    System:

    Android SDK Tools : 26.0.1
    Node              : v8.0.0
    OS                : Linux 4.10
    npm               : 5.3.0 
    
  8. edzillion commented on Aug 8, 2017

    @edzillion

    Still getting this bug with latest:

    cli packages: (E:\dev\circles_testnet_v2\node_modules)

    @ionic/cli-plugin-cordova       : 1.6.2
    @ionic/cli-plugin-ionic-angular : 1.4.1
    @ionic/cli-plugin-proxy         : 1.4.1
    @ionic/cli-utils                : 1.7.0
    ionic (Ionic CLI)               : 3.7.0
    

    global packages:

    Cordova CLI : 7.0.1
    

    local packages:

    @ionic/app-scripts : 2.1.3
    Cordova Platforms  : android 6.2.3 browser 4.1.0 ios 4.4.0
    Ionic Framework    : ionic-angular 3.5.3
    

    System:

    Node : v6.11.2
    OS   : Windows 8.1
    npm  : 4.1.2
    
  9. wowkucko commented on Jan 31, 2018

    @wowkucko

    Have you ever found an actual working solution for this? I don't want to put all my input fields into one page, i guess slides are my only option.

  10. edzillion commented on Jan 31, 2018

    @edzillion

    Not I @wowkucko

  11. miguel-sobong commented on Feb 13, 2018

    @miguel-sobong

    getting this too

  12. yohoprashant commented on Mar 22, 2018

    @yohoprashant

    same here.. and I am stuck in the middle of a project.

    cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0
    

    global packages:

    cordova (Cordova CLI) : 8.0.0 
    

    local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 7.0.0 browser 5.0.3
    Ionic Framework    : ionic-angular 3.9.2
    

    System:

    Android SDK Tools : 26.1.1
    Node              : v9.4.0
    npm               : 5.6.0 
    OS                : macOS High Sierra
    
  13. shehrazjazib commented on May 18, 2018

    @shehrazjazib

    I am facing still this issue when keyboard open, my slides go up and didn't show, until keyboard hide.

  14. jdnichollsc commented on May 30, 2018

    @jdnichollsc

    any solution?

  15. yohoprashant commented on Jul 10, 2018

    @yohoprashant

    I had same problem. But I was surprised when It worked after adding a div tag around ion-slides.

  16. madsheep commented on Jul 11, 2018

    @madsheep

    The issue comes from the fact that ion-slides have 100% height set, so each slide covers whole screen from top to bottom. The workaround from @yohoprashant works because putting your ion-slides in a div without styles sets their height to 100% of unstyled div (and that let's page scroll normally again)

    A more explicit, but similar fix could be:

    component:

    import { Keyboard } from 'ionic-angular'
    export class MyComponent { 
      constructor (
        private keyboard: Keyboard
      ){}
    }
    

    html:

    <ion-slides [class]="keyboard.isOpen() ? 'open-keyboard' : 'closed-keyboard'">
    (...)
    </ion-slides> 
    

    css:

    .open-keyboard {
      ion-slides {
        height: auto;
      }
    }
    .closed-keyboard {
      ion-slides {
        height: 100%;
      }
    }
    
  17. ionitron-bot commented on Sep 1, 2018

    @ionitron-bot

    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.

  18. locked and limited conversation to collaborators on Sep 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions