-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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: ion-menu containing an ion-accordion scrolls up every time the menu opens #24634
Comments
Thanks for the issue, I'm able to replicate in both Angular and core. The bug triggers if you have at least one accordion in a menu. It doesn't trigger with just a list in the menu, but I saw it using just one accordion group with one accordion. It looks like the accordion's content can be anything; you don't necessarily need an |
Additional context from #24660, this also appears to happen when the In that example, it's also replicable with |
Verified that this issue was introduced in #24076. After the menu has finished animating, the menu will focus the immediate child element that matches this query selector:
This will either focus an accordion item, a routerLink or other focusable elements. Ideally if we need to set the focus target, we should be preserving scroll position of the container. |
I was wondering if there is any indication on when this will be fixed? If it would scroll to the active routerLink element it would not be a big problem. However, it scrolls to the highest routerLink in the menu, also when the active routerlink is in the bottom. This can be a bit confusing for our customers. |
My workaround:
|
Thanks @JoeMeeks but we need ionic to fix such a dumb thing… hey @amandaesmith3 any updates on it? |
I think/hope it is related, but I'm experiencing the jumpy behavior on page transitions that do not involve the menu changing. |
@moekify Could you open a separate issue with a reproduction app? This issue is specifically for the menu scroll position jumping on close/reopen. |
Sure thing, here's a dev build you can use: |
This has been resolved via #25044, and the fix will be available in a future release of Ionic 👍 |
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. |
Prerequisites
Ionic Framework Version
Current Behavior
If we put a ion-accordion inside a ion-menu with a ion-split-pane app, the menu scrolls up every time you close and reopen the ion-menu. The ion-menu scroll up right after the event ionDidOpen finishes.
Expected Behavior
The ion-menu must keep the scroll postion. This behavior is seen if you put a ion-list + ion-item in a ion-menu.
Steps to Reproduce
Just create a side menu app (ionic start and side menu) and then place a multiple ion-accordion / ion-accordion-group. In the link provided,
Code Reproduction URL
https://stackblitz.com/edit/ionic-5-custom-ion-menu-button-jikmqz?file=src/app/tab1/tab1.page.html
Ionic Info
Ionic CLI : 6.18.1 (/node/v12.22.5/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 6.0.1
@angular-devkit/build-angular : 12.2.14
@angular-devkit/schematics : 12.2.14
@angular/cli : 12.2.14
@ionic/angular-toolkit : 5.0.1
Additional Information
No response
The text was updated successfully, but these errors were encountered: