Skip to content
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

bug: ion-slides with form inputs #5744

Closed
dylanvdmerwe opened this issue Mar 7, 2016 · 23 comments
Closed

bug: ion-slides with form inputs #5744

dylanvdmerwe opened this issue Mar 7, 2016 · 23 comments

Comments

@dylanvdmerwe
Copy link
Contributor

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
@EvanWillms
Copy link

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

@adamdbradley
Copy link
Contributor

Related: #6133

@Bouzmine
Copy link
Contributor

@jgw96 Could you reopen this issue? I facing it using the latest version of ionic (beta.11).

@Chuckv01
Copy link

Chuckv01 commented Oct 4, 2016

@jgw96 This is still happening with RC0.

@manucorporat manucorporat reopened this Oct 4, 2016
@jamesgroat
Copy link
Contributor

@manucorporat I'm seeing this as well. (also FYI this issue is assigned to a closed milestone)

@ivanmayes
Copy link

Happening in Ionic 1 with ion-slides as well.

@jgw96 jgw96 modified the milestones: 2.0.0-rc.2, 2.0.0-beta.10 Oct 12, 2016
@jgw96 jgw96 added this to the 2.0.0-rc.3 milestone Nov 1, 2016
@jgw96 jgw96 removed the needs: reply the issue needs a response from the user label Nov 1, 2016
@brandyscarney brandyscarney modified the milestone: 2.0.0-rc.3 Nov 4, 2016
@kazigais
Copy link

Any workaround?

@jgw96
Copy link
Contributor

jgw96 commented Dec 14, 2016

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

@jgw96 jgw96 closed this as completed Dec 14, 2016
@LiveListMobile
Copy link

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.

@juanpmarengo
Copy link

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 

@edzillion
Copy link

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

@wowkucko
Copy link

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.

@edzillion
Copy link

Not I @wowkucko

@miguel-sobong
Copy link

getting this too

@yohoprashant
Copy link

yohoprashant commented Mar 22, 2018

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

@shehrazjazib
Copy link

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

@jdnichollsc
Copy link

any solution?

@yohoprashant
Copy link

yohoprashant commented Jul 10, 2018

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

@madsheep
Copy link

madsheep commented Jul 11, 2018

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%;
  }
}

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 1, 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 1, 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