ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Ionic 1.3.1: Nested views (2nd-level+) need the overflow-scroll class, or they don't display.

Open YellowSharkMT opened this issue 10 years ago • 1 comments

I think I've discovered an issue with nesting views. The content in the 2nd-level views is not displayed, unless you add class "overflow-scroll" to the parent <ion-content> element.

To create the issue:

  1. ionic start test_app sidemenu

  2. Edit www/js/app.js, and add the following lines to the end of the .config() block:

    $stateProvider
        .state('app.foo', {
            url: '/foo',
            abstract: true,
            views: {
                menuContent: {
                    // this template does not work:
                    template: '<ion-view><ion-content><ion-nav-view name="testView"></ion-nav-view></ion-content></ion-iew>'
                    // this template DOES work:
                    // template: '<ion-view><ion-content class="overflow-scroll"><ion-nav-view name="testView"></ion-nav-view></ion-content></ion-iew>'
                }
            }
        })
        .state('app.foo.bar', {
            url: '',
            views: {
                testView: {
                    template: '<ion-view><ion-content>CONTENT INSIDE OF testView</ion-content></ion-view>'
                }
            }
        });
    

And then update the $urlRouterProvider so that it shows this page on load:

$urlRouterProvider.otherwise('/app/foo');

Go ahead and run the app, and what you'll see is nothing, which I believe is a problem. If you edit the snippet above so that the line for the template that works is uncommented (be sure to comment out the first one), you will see that the content appears. It appears that without this "overflow-scroll" class, the div.scroll element (direct child of the app.foo template's <ion-content> element) receives a CSS transform rule that prevents the testView view from being visible.

Is that the expected behavior, or am I doing something wrong?

YellowSharkMT avatar Aug 25 '16 15:08 YellowSharkMT

Hello, thanks for opening an issue with us! I am going to close this issue as a duplicate of https://github.com/driftyco/ionic/issues/5954. Thanks for using Ionic!

jgw96 avatar Sep 01 '16 22:09 jgw96