Skip to content

bug: scrolling is broken after using ion-refresher together with ion-segment #22590

@sebastian-zarzycki-apzumi

Description

Bug Report

Ionic version:
[ ] 4.x
[x] 5.x

Current behavior:
When pulling down to enable refresher, sometimes (usually after content switch/repaint, so, for example, after switching segments) the content seems to be going several pixels down and is no longer scrollable (either in web version and in mobile native build). Seems that it is connected to segments somehow.

This does not happen with a refresher in a view without segments.

This error appears only in newest Ionic versions. It does not happen in @ionic/angular 5.4.1

Nov-27-2020 14-42-13

Expected behavior:
Content should still be scrollable. No content movement.

Steps to reproduce:
Use refresher inside a view that is steered by ion-segment.

Related code:
Roughly:

<ion-content>

  <ion-segment [value]="currentTab" (ionChange)="onTabChange($event)">
    <ion-segment-button [value]="Tab.ACTIVE">
      <ion-label>ACTIVE</ion-label>
    </ion-segment-button>
    <ion-segment-button [value]="Tab.PAST">
      <ion-label>PAST</ion-label>
    </ion-segment-button>
  </ion-segment>

  <div class="ion-padding">
    <ng-container *ngIf="currentTab === Tab.ACTIVE">
      <ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
        <ion-refresher-content></ion-refresher-content>
      </ion-refresher>
   </ng-container>
 </div>

</ion-content>

Other information:
Ionic info:

Ionic:

   Ionic CLI                     : 6.12.2 (/opt/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.5.1
   @angular-devkit/build-angular : 0.1001.6
   @angular-devkit/schematics    : 10.1.0
   @angular/cli                  : 10.1.6
   @ionic/angular-toolkit        : 2.3.3

Cordova:

   Cordova CLI       : 10.0.0
   Cordova Platforms : 6.0.0, android 9.0.0, browser, ios 6.1.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 13 other plugins)

Utility:

   cordova-res : 0.15.2
   native-run  : 1.2.2

System:

   Android SDK Tools : 26.1.1 (/Users/rattkin/Library/Android/sdk)
   ios-deploy        : 1.11.3
   ios-sim           : 8.0.2
   NodeJS            : v14.15.1 (/opt/local/bin/node)
   npm               : 6.14.9
   OS                : macOS Big Sur
   Xcode             : Xcode 12.2 Build version 12B45b

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions