Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 tasks done
DwieDima opened this issue Mar 11, 2024 · 4 comments
Closed
3 tasks done
Labels

Comments

@DwieDima
Copy link
Contributor

DwieDima commented Mar 11, 2024

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

@ionitron-bot ionitron-bot bot added the triage label Mar 11, 2024
@DwieDima DwieDima 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 Mar 11, 2024
@thetaPC
Copy link
Contributor

thetaPC commented Mar 12, 2024

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.

@thetaPC thetaPC closed this as completed Mar 12, 2024
@thetaPC thetaPC removed their assignment Mar 12, 2024
@DwieDima
Copy link
Contributor Author

DwieDima commented Mar 14, 2024

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

@thetaPC
Copy link
Contributor

thetaPC commented Mar 15, 2024

@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!

Copy link

ionitron-bot bot commented Apr 14, 2024

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Apr 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants