-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
Functions inside qscrollarea keeps getting called over and over when scrollbar changes (visibility or movement) #16579
Comments
If you want to call functions inside the content then put your content in a component, so that vue can optimize the rendering |
Extracting everything inside q-scroll-area into a separate component does indeed solve the issue. It's still not ideal as I have about 10 places I need to do this and it requires creating a new component, and extracting out logic into a mixin. But it's a path forward. |
Strangely search didn't pick up this one. Copying the suggestions over from my report: Since all the computed value updates relate to thumb display, the straight forward solution would be to pull out the thumb rendering logic into pure JS world. I also suspect there is a way to rewrite the render function (rather than relying on the compiler) using vnode creation calls to mark the child nodes (ones inserted via the slot) as isolated from thumb-related nodes.
Separate component does not solve the underlying issue: Vue will still invoke the render function of that separate component for every value update inside QScrollArea. Known workaroundFor those that are seeking a workaround, you can use |
Hi! I am building a component based on Hope the PR gets merged soon 😄 , for now i'll use a simple scrolling div instead of |
Perf improvement will be available in Quasar v.2.17.0 |
What happened?
So I'm noticing odd function call behavior inside a qscrollarea. It seems anytime I mouse over the scroll area the function gets called which is not what happened in v1. Computed behaves as expected. And you don't even have to scroll. Just mouse enter and leave and you'll see the function get hit. How do I revert back to how v1 behaved or is this some odd vue 3 reactivity interaction I'm not understanding. It seems to be tied to scroll bar. If I set it to visible I can mouse over and out all day and it won't trigger b/c the scroll bar isn't fading in and out. Unfortunately, moving the scroll bar will also trigger the function call.
What did you expect to happen?
I expected it to not constantly call functions inside qScrollArea. Quasar v1 does not exhibit this behavior.
Reproduction URL
https://codepen.io/aroganx/pen/gOqWgBY
How to reproduce?
Run the codepen and just mouse over in and out of scroll area. Scrolling in the scroll area will also cause the function to get called repeatedly.
Flavour
Quasar CLI with Webpack (@quasar/cli | @quasar/app-webpack)
Areas
Components (quasar)
Platforms/Browsers
Chrome
Quasar info output
Relevant log output
testComputed: 1 testFx: 16 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
Additional context
No response
The text was updated successfully, but these errors were encountered: