Skip to content

bug(refresher): mode does not account for child pages with global mode set #29137

Closed as not planned

Description

@DwieDima

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

When global mode is defined e.g. in angular using IonicModule.forRoot({ mode: 'ios' }), ion-refresher does not respect custom mode ('md') defined on component level on child pages.

Bildschirmaufnahme.2024-03-11.um.14.23.11.mov

Expected Behavior

mode on component level for ion-refresher should be applied also on child pages

Steps to Reproduce

See Stackblitz

  1. open "Listen Now" Tab
  2. pull-to-refresh --> md refresher is visible
  3. click button "detail"
  4. pull-to-refresh --> web refresher is visible (iOS)

Code Reproduction URL

https://stackblitz.com/edit/angular-od4spf?file=src%2Fapp%2Fhome%2Fhome-page.component.html

Ionic Info

7.x

Additional Information

No response

Activity

  1. changed the title [-]bug(refresher): mode does not account for child pages with global mode[/-] [+]bug(refresher): mode does not account for child pages with global mode set[/+] on Mar 11, 2024
  2. thetaPC commented on Mar 12, 2024

    @thetaPC
    Contributor

    Thank you for submitting the issue!

    The issue is due to the RouterModule.forChild() setup in src/app/home/home-page.module.ts, it needs some adjustments to render the correct mode. You can use the code snippet below instead of your current one, and then you'll see that the ion-refresher will work properly, even if your page is nested inside other pages.

    RouterModule.forChild([
      {
        path: '',
        component: HomePageComponent,
        children: [
          {
            path: 'detail',
            loadChildren: () => import('./home-page.module').then(m => m.HomePageModule)
          }
        ]
      }
    ])

    If there are any other problems, please open a new issue.

  3. removed their assignment
    on Mar 12, 2024
  4. DwieDima commented on Mar 14, 2024

    @DwieDima
    ContributorAuthor

    Hi @thetaPC

    thank you for your snippet!
    After further investigation, this bug does not only occur on child pages, but also on all tab pages where only the first initialized tab is working.
    I extended the stackblitz, where I also added the refresher to the radio tab.

    1. open listen now tab
    2. pull-to-refresh
    3. refresh with md design works
    4. switch to radio tab
    5. pull-to-refresh
    6. web refresher is visible

    since this bug also occurs on sibling pages where it cannot fixed by router as you suggested, is it possible to reopen the ticket?

    Bildschirmaufnahme.2024-03-14.um.12.06.39.mov
  5. thetaPC commented on Mar 15, 2024

    @thetaPC
    Contributor

    @DwieDima Please start a new issue just for this particular bug. We need each problem to have its own space so we can fix them properly. I highly recommend stripping the project down by removing the child pages since the new issue would focus on the tab pages. Thanks for understanding!

  6. ionitron-bot commented on Apr 14, 2024

    @ionitron-bot

    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.

  7. locked and limited conversation to collaborators on Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions