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

Ionic 2 popover: Doesn't allow content to scroll #7117

Closed
RaymondAtivie opened this issue Jun 29, 2016 · 7 comments
Closed

Ionic 2 popover: Doesn't allow content to scroll #7117

RaymondAtivie opened this issue Jun 29, 2016 · 7 comments

Comments

@RaymondAtivie
Copy link

RaymondAtivie commented Jun 29, 2016

Short description of the problem:

A page is not scroll able if it was navigated to from a click event in a popover

What behavior are you expecting?

Expected behaviour is for the page to be scroll able regardless of where it is navigated from as long as the contents is more than the view point.

Steps to reproduce:
i have a plunker for this http://plnkr.co/edit/v5oBFP?p=preview

Other information:
I'm guessing this happens because the popover from the previous page isn't closed before navigating thereby freezing the page 'scrollability'.

Trying to manually close it before navigating doesn't work either
manually closing the popover after navigation with a setTimeout function. solves the problem.
But shouldn't this be done automatically?

Which Ionic Version? 1.x or 2.x
Ionic 2.x

Plunker that shows an example of your issue

http://plnkr.co/edit/v5oBFP?p=preview

Cordova CLI: 5.2.0
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.9
Ionic CLI Version: 2.0.0-beta.30
Ionic App Lib Version: 2.0.0-beta.16
OS:
Node Version: v4.3.2

@jgw96
Copy link
Contributor

jgw96 commented Jun 29, 2016

Hello! Thanks for opening an issue with us. Since our whole navigation system in Ionic 2 is async you use promises to wait for each transition to finish before starting a new one. I have made another plunker here that shows the proper way to do this. As you can see, i call viewController.dismiss() which returns a promise that when resolved pushes the page. To read more about how this works in Ionic 2 you can read more here. Thanks for using Ionic!

@akz92
Copy link

akz92 commented Aug 26, 2016

@jgw96 could you please update the plunker using the latest release? I get the following error when I try to do what you did:

Property 'present' does not exist on type 'NavController'

Edit:
And if I do the following I don't get the back button on the page I'm going after using this.viewCtrl.dismiss():

popover.present({
  ev: ev
});

@jgw96
Copy link
Contributor

jgw96 commented Aug 26, 2016

@akz92 Unfortunately there are currently some issues with npmcdn that are causing the plunker not to work. Sorry for any hassle that causes. Are you having this issue with a project running beta.11 or just the plunker?

@akz92
Copy link

akz92 commented Aug 26, 2016

@jgw96 I'm having this issue with a project running beta.11. If I navigate to ListPage from HomePage the back button appears on ListPage's header, but if I navigate from Page1 to ListPage the back button isn't on ListPage's header.

@jgw96
Copy link
Contributor

jgw96 commented Aug 26, 2016

Could you post a code sample or repo that i could use to reproduce this issue? Thanks!

@akz92
Copy link

akz92 commented Aug 29, 2016

@jgw96 sorry for the delay. I created a repo that you can use to reproduce the issue: Popover nav example

@akz92
Copy link

akz92 commented Sep 1, 2016

I solved the issue by changing the way I dismiss the popover. Now i call this.viewCtrl.dismiss() inside ionViewDidLeave() and everything works fine.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 8, 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

4 participants