-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Do not select stacked pages when querying for previous page in router back #3979
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
Conversation
|
Merged, thanks! |
|
Hi, this PR uncovers a different bug: when trying to preload, a new page element is created/added instead of using the stacked one. This is the code path: In the second call to I think the better is to revert this change while a proper fix (reuse the stacked page) is done. |
|
Is the preload code path necessary at all when using A possible fix is to skip preload when stackPages: true |
|
I have reverted and pushed another fix, can you check if it works for you now? |
|
Thanks. This fixes the original issue and also prevents the component being recreated when using stackPages. I noticed the stacked class is kept in previous page when navigating backward giving a different structure when navigating forward in the same page. In the example when going to the "Fact" page, starting from home, i get the following dom structure: <div class="view view-main ios-edges">
<div class="page page-previous stacked" data-name="home" aria-hidden="true"></div>
<div class="page page-previous" data-name="person" aria-hidden="true"></div>
<div class="page page-current" data-name="fact"></div>
</div>When going to "about" page and going back to "fact", i get the following structure (the previous page keeps the stacked class) <div class="view view-main ios-edges">
<div class="page page-previous stacked" data-name="home" aria-hidden="true"></div>
<div class="page page-previous stacked" data-name="person" aria-hidden="true"></div>
<div class="page page-current" data-name="fact"></div>
</div>This seems to prevent swipeBack feature. Should i open a knew issue? |
|
Just found a issue when using stackPages: false with duplicated dom page elements but seems not related to this change because i reverted back and and still persists. Will investigate further and report |
Fixed now |
Fixes #3975
This change does not select .stacked pages when determining previous page.
Uses the same selector used e.g. in https://github.com/framework7io/framework7/blob/master/src/core/modules/router/back.js#L343