[Ionic v4.0.0-beta.8] ion-slides positioning bug
See original GitHub issueBug Report
Ionic Info Ionic:
ionic (Ionic CLI) : 4.1.2 (C:\Users\Gezbo\AppData\Roaming\npm\node_modules\ionic) Ionic Framework : @ionic/angular 4.0.0-beta.7 @angular-devkit/core : 0.7.5 @angular-devkit/schematics : 0.7.5 @angular/cli : 6.1.5 @ionic/ng-toolkit : 1.0.8 @ionic/schematics-angular : 1.0.6
Cordova:
cordova (Cordova CLI) : 8.0.0 Cordova Platforms : none Cordova Plugins : not available
System:
Android SDK Tools : 26.1.1 (C:\Android\android-sdk) NodeJS : v8.11.4 (C:\Program Files\nodejs\node.exe) npm : 6.4.1 OS : Windows 10
Describe the Bug
If you have an ion-slides
element on the default home page the calculated width (applied by ionic) of the ion-slide
elements is of a value similar to the full screen (instead of the main pane) causing the content to look like it is not centered. If you reload the page by navigating to another page and back again, this issue does not occur.
Steps to Reproduce
- Create a sidemenu project via the cli
- Move the 2 pages into a ‘pages’ folder and update the routing/references
- Create a component to hold the ion-slides
- Add the component to the default home page
- Load the app
Expected Behavior When the app loads, the ion-slides should load in the same way as when the page is accessed via the menu,
Additional Context I think this is something to do with the rendering order. In the bug scenario, all the ion-slide elements seem to have a width that is roughly equal to the page width, leading me to believe that somehow,the pane width has not been calculated and so is not used. When you load the page via the menu item, the pane has already been rendered so the width is known, so the problem does not manifest.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Could be related https://github.com/ionic-team/ionic/pull/15576
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.