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.

Scroll content + scroll popover doesn't work properly

See original GitHub issue

Bug Report

Ionic version: [x] 4.0.0-rc.0

Current behavior: I have a long list in my root component (HomeComponent) which each has a button to open a popover to choose a category. Problem is, if I use ion-content for the PopoverComponent (CategoryPicker), the popover can’t be scrolled anymore. If I don’t wrap the PopoverComponents HTML code in ion-content, I can scroll the Popover, but if I try to overscroll in the popover, the background gets scrolled.

Expected behavior: Popover open -> ONLY Popover should be scrollable, not the background or anything else

Steps to reproduce:

  • Create a Base Page with a long ion-list that forces you to scroll
  • Add a button to each list item that opens a popover
  • The popover should have a long list that forces you to scroll, too
  • Try to wrap the popover components in ion-content -> Popover overscrolls but doesn’t really scroll down/up to see other entries
  • Try to remove ion-content -> Popover scrolls, but if you overscroll inside the popover, the list in the base page is being scrolled

Related code: Fab Button to open Category Picker

      <ion-fab-button size="small" color="medium" style="margin-top: 10px;" (click)="category(entry._id, $event)"
                      [disabled]="expense || income">
        <ion-icon [name]="data.getCategory(entry.category).icon || 'add'"></ion-icon>
      </ion-fab-button>

Method that creates and present Category Picker

  async category(id: string, ev) {
    const popover = await this.popover.create({
      component: CategoryPickerPage,
      componentProps: {id: id},
      translucent: true,
      keyboardClose: true,
      event: ev,
      showBackdrop: true
    });
    popover.present();
  }

Actual CategoryPicker Component (Commented out ion-content, it can be tried with or without it)

<!--<ion-content>-->
    <ion-list lines="none">
      <ion-item *ngFor="let category of Category.categories" (click)="pick(category.id)" lines="none">
        <ion-icon slot="start" [name]="category.icon"></ion-icon>
        <ion-label>{{category.name}}</ion-label>
      </ion-item>

      <ion-item (click)="pick('none')" lines="none">
        <ion-icon slot="start" name="add"></ion-icon>
        <ion-label>Keine Kategorie</ion-label>
      </ion-item>
    </ion-list>
<!--</ion-content>-->

Other information: I’ve made 2 videos. This one shows the behavior with <ion-content> wrapper: http://zeriouh.io/shared/withcontent.TRIM.mp4

This is the behavior without <ion-content> wrapper: http://zeriouh.io/shared/withoutcontent.TRIM.mp4

Ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.6.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.0-rc.0
   @angular-devkit/build-angular : 0.10.7
   @angular-devkit/schematics    : 7.0.7
   @angular/cli                  : 7.0.7
   @ionic/angular-toolkit        : 1.2.0

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : ios
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.5, (and 4 other plugins)

System:

   ios-deploy : 1.9.4
   ios-sim    : 7.0.0
   NodeJS     : v10.0.0 (/usr/local/bin/node)
   npm        : 6.5.0
   OS         : macOS Mojave
   Xcode      : Xcode 10.1 Build version 10B61

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
chriswepcommented, Mar 28, 2019

as a temporary workaround, i could make this work by adding this global css:

.backdrop-no-scroll ion-content {
    --overflow: hidden;
}

Since Ionic is already adding the backdrop-no-scroll class to the body, it feels like they just forgot to implement the no-scroll part of it?

8reactions
foochuanyuecommented, Feb 14, 2019

facing the same issue +1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scroll content + scroll popover doesn't work properly #16910
Try to wrap the popover components in ion-content -> Popover overscrolls but doesn't really scroll down/up to see other entries; Try to remove ......
Read more >
Scroll content + scroll popover doesn't work properly in ionic 4
When popover present part of content visible not all content and can not scroll to show all content. After searching I find this...
Read more >
Object too close to top edge of Popover frame won't scroll
Tap the date field to open the popover. Scroll the popover contents up and down and note that the location field does not...
Read more >
Popover - Cannot scroll inside the popup - DevExpress Support
To resolve this issue, add a ScrollView widget to Popover's content template. Please refer to the following demo that illustrates this approach: ...
Read more >
How do I get content in a popover to scroll? — XM Community
To find the element from your browser, go the page with the popover then right click on the text and go to Inspect....
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