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

scrollBehavior scroll to top not working if the Loading plugin is active #13202

Open
jonfelixrico opened this issue Apr 18, 2022 · 3 comments
Open
Labels
area/plugins bug/1-repro-available A reproduction is available and needs to be confirmed. kind/bug 🐞 mode/spa Qv1

Comments

@jonfelixrico
Copy link

What happened?

When navigating between pages with overflowing content, the position of the scroll seems to be preserved even if we've set scrollBehavior in the Vue Router settings to scroll to top. This seems to only happen if Loading.show and Loading.hide happened between navigation (more info on the codesandbox example).

What did you expect to happen?

I expected that the next page's scroll position would be at the top.

Reproduction URL

https://codesandbox.io/s/async-cookies-qlh7tb

How to reproduce?

  1. Go to the provided link
  2. Go to the root url (/#/)
  3. Scroll to the middle of the list
  4. Click on one of the text of the divs (make sure that your scrollbar visibly shows that its in the middle)
  5. You will be navigated to the next page (/#/details)

Flavour

Quasar CLI (@quasar/cli | @quasar/app)

Areas

Plugins (quasar), SPA Mode

Platforms/Browsers

Firefox, Chrome, Microsoft Edge

Quasar info output

Operating System                Windows_NT(10.0.19043) - win32/x64
NodeJs                          16.14.2

Global packages
  NPM                           8.5.0
  yarn                          1.22.18
  @quasar/cli                   1.3.2
  @quasar/icongenie             Not installed
  cordova                       Not installed

Networking
  Host                          felix-pc
  NordLynx                      10.5.0.2
  OpenVPN TAP-Windows6          192.168.51.7
  vEthernet (Default Switch)    172.17.64.1
  Ethernet                      192.168.254.50
  VirtualBox Host-Only Network  192.168.56.1
  vEthernet (WSL)               172.21.112.1

Relevant log output

No response

Additional context

If you remove the usage of Loading.show and Loading.hide in the beforeRouteEnter in pages/Details.vue, navigation to this component will scroll to top (expected behavior).

The example have the same page height, This still will happen regardless if they have the same height or not, as long as the page has overflowing content.

@github-actions github-actions bot added area/plugins bug/1-repro-available A reproduction is available and needs to be confirmed. mode/spa labels Apr 18, 2022
@kalvenschraut
Copy link
Contributor

Underlying issue appears to be same as I noted in #12994

@jonfelixrico
Copy link
Author

jonfelixrico commented May 5, 2022

To add: looks like the issue happens regardless if I was using QLayout or not. The repro link in the issue description uses a QLayout. This link (https://codesandbox.io/s/holy-firefly-s8jkzx) uses divs. Just wanted to put it out here since it might be of some use.

Because this happens even with QLayout or without QLayout (maybe just divs), I think the underlying issue is within the Loading plugin itself. The underlying issue might be different from what was in #12994 since it's implied there that it's within QLayout's onPageScroll handling.

@lmfmaier
Copy link

lmfmaier commented May 7, 2022

I'm experiencing a similar issue with QLayout and QInfiniteScroll with skeleton loaders. When I scroll the page and change the route, the next page is not scrolled to top.

This also happens when I don't use scroll behaviour at all

pdanpdan added a commit to pdanpdan/quasar that referenced this issue Mar 4, 2023
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Mar 9, 2023
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Mar 17, 2023
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Mar 17, 2023
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Mar 17, 2023
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Mar 21, 2023
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Mar 21, 2023
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Mar 31, 2023
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Apr 4, 2023
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Apr 27, 2023
pdanpdan added a commit to pdanpdan/quasar that referenced this issue May 4, 2023
pdanpdan added a commit to pdanpdan/quasar that referenced this issue May 5, 2023
pdanpdan added a commit to pdanpdan/quasar that referenced this issue May 12, 2023
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Sep 4, 2023
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Sep 8, 2023
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Oct 21, 2023
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/plugins bug/1-repro-available A reproduction is available and needs to be confirmed. kind/bug 🐞 mode/spa Qv1
Projects
None yet
Development

No branches or pull requests

3 participants