question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[4.0.0-rc.2] ion-slides do not resize after screen orientation changes in iOS

See original GitHub issue

Bug Report

Ionic version: [x] 4.x

Current behavior: [4.0.0-rc.2] ion-slides do not resize after screen orientation changes in iOS

Expected behavior: ion-slides should resize when orientation changes in iOS

Steps to reproduce:

  1. Create a new ionic 4 app and add 3 or 4 slides. Or take ionic-conference-app and upgrade to 4.0.0-rc.2
  2. Build project for iOS
  3. Install on device or run in simulator and change orientation

Ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.7.1 (C:\Users\gigoc\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.0.0-rc.1
   @angular-devkit/build-angular : 0.12.1
   @angular-devkit/schematics    : 7.1.4
   @angular/cli                  : 7.1.4
   @ionic/angular-toolkit        : 1.2.2

Cordova:

   cordova (Cordova CLI) : not installed
   Cordova Platforms     : not available
   Cordova Plugins       : not available

System:

   NodeJS : v8.11.3 (C:\Program Files\nodejs\node.exe)
   npm    : 6.5.0
   OS     : Windows 10

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:19 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
leechycommented, Mar 21, 2019

My recipe:

Template:

<ion-slides #slides>
...
</ion-slides>

Class:

  ...
  @ViewChild('slides') slides;
  ...
  @HostListener('window:resize')
  onResize() {
    setTimeout(() => this.slides.update(), 100);
  }

I’m using setTimeout() because I’m using <ion-split-pane> and there can be one more resize of the <ion-content> after the browser window resize. And listen to ionSplitPaneVisible makes everything much more complicated. But if you are not using additional elements affecting component size, you can easily drop the setTimeout.

But still — it’ll be better if the component listens to it’s size changes internally.

HTH

4reactions
conde2commented, Sep 11, 2020

Having same issue, this bug is very old, no fix so far?

Read more comments on GitHub >

github_iconTop Results From Across the Web

[4.0.0-rc.2] ion-slides do not resize after screen orientation ...
Bug Report. Ionic version: [x] 4.x. Current behavior: [4.0.0-rc.2] ion-slides do not resize after screen orientation changes in iOS.
Read more >
[4.0.0-rc.2] ion-slides do not resize after screen orientation changes ...
Bug Report. Ionic version: [x] 4.x. Current behavior: [4.0.0-rc.2] ion-slides do not resize after screen orientation changes in iOS. Expected behavior:
Read more >
Why doesn't my view auto resize af… | Apple Developer Forums
I have an app using the splitscreen controller. The detail view part of it does not resize when the iPad orientation changes. All...
Read more >
ion-slides bad placement after screen orientation change
In the app component I control the screen orientation behavior of the app. Can be a bit tricky. The isOverlay property is for...
Read more >
Screen Orientation - Ionic Framework
Cordova Screen Orientation plugin sets/locks the screen in a common way. Read more on how to change screen orientation on Android, iOS, or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found