QwikDev / qwik

Instant-loading web apps, without effort
https://qwik.dev
MIT License
20.45k stars 1.26k forks source link

[🐞] View transition and scroll restore conflicts #6076

Closed jordanw66 closed 20 hours ago

jordanw66 commented 3 months ago

Which component is affected?

Qwik Runtime

Describe the bug

Not sure what the issue is yet but it's alluded to in this issue (my comment): https://github.com/BuilderIO/qwik/pull/6068#issuecomment-2028448433

Essentially, every SPA navigate in Qwik City automatically invokes a view transition (it's enabled by default) unless the QwikCity component's viewTransition prop is explicitly set to false. However, view transitions are effectively disabled by some CSS Manu originally added. When that CSS was removed, the scroll restore tests failed, suggesting that even Chrome's basic view transition effect somehow clashes with scroll restore.

I think it might be some kind of race condition as mentioned here: https://stackoverflow.com/a/76973540

Which would make this an issue in Qwik core, relevant code might be here: https://github.com/BuilderIO/qwik/blob/fd2ccbd641c12afce90ec45696c9d598cd4a34d7/packages/qwik/src/core/render/dom/visitor.ts#L1173-L1179

I don't think this is a large issue and probably easy to fix, if nobody gets to it I will eventually when I have time to investigate. Opening this issue so it's not forgotten.

Reproduction

N/A

Steps to reproduce

No response

System Info

N/A

Additional Information

No response

gioboa commented 2 weeks ago

Thanks @jordanw66 Can you create a basic reproduction pls?

github-actions[bot] commented 2 weeks ago

Hello @jordanw66. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with STATUS-2: needs reproduction will be automatically closed if they have no activity within 14 days. Thanks 🙏