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

shouldRecycle=false breaks UI when scrolling the elements fast. #296

Open
ahamedalthaf opened this issue Sep 5, 2019 · 9 comments
Open
Labels

Comments

@ahamedalthaf
Copy link
Contributor

ahamedalthaf commented Sep 5, 2019

'shouldRecycle: false' is breaking the UI when we try to scroll faster. This breaks the UI and completely block the user from doing any activity.

Version: "@html-next/vertical-collection": "1.0.0-beta.12"

Please find the error below in the browser console.

Assertion Failed: value must non-negative

@RobbieTheWagner
Copy link
Member

@ahamedalthaf can you try the latest version please?

@ahamedalthaf
Copy link
Contributor Author

@rwwagner90 tried with latest version and still seeing the same issue.

@NullVoxPopuli
Copy link

NullVoxPopuli commented Sep 7, 2019

I'm experiencing this on emberclear, too :(

I enabled shouldRecycle='false' because without it the item's did-insert modifier/hook isn't reused... which is problematic 🤷‍♂️

@ahamedalthaf
Copy link
Contributor Author

@rwwagner90 I have fixed this issue in the PR raised. Please check from your side.

@RobbieTheWagner
Copy link
Member

Thanks @ahamedalthaf!

ahamedalthaf added a commit to ahamedalthaf/vertical-collection-1 that referenced this issue Oct 11, 2019
flexyford added a commit to flexyford/vertical-collection that referenced this issue Feb 4, 2020
Should render the appendComponentPool only if ‘shouldRecycle’ is false

We can stop using this fork when the following Issue/PR is resolved:

html-next#296
html-next#299
lan0 pushed a commit to lan0/vertical-collection that referenced this issue Jun 8, 2020
Should render the appendComponentPool only if ‘shouldRecycle’ is false

We can stop using this fork when the following Issue/PR is resolved:

html-next#296
html-next#299
@knownasilya
Copy link
Contributor

Was seeing nextSibling of undefined in the glimmer vm with this flag as well.

RobbieTheWagner pushed a commit that referenced this issue Feb 1, 2022
…#296 (#299)

* shouldRecycle=false breaks UI when scrolling the elements fast. Issue#296

shouldRecycle=false breaks UI when scrolling the elements fast.

Issue#296

* shouldRecycle=false breaks UI when scrolling the elements fast. Issue #296

* Should render the appendComponentPool only if ‘shouldRecycle’ is false
@jbottigliero
Copy link

While the referenced PR has been merged for some time (looks like it would have landed in 3.0.0), I'm encountering a similar error in newer versions.

I've tested in both 4.0.1 and 3.1.0, both versions result in a similar error, the below report is from 4.0.1 (latest at time of writing):

Uncaught Error: Assertion Failed: value must non-negative
    at Object.assert (index.js:181:1)
    at SkipList.set (-private.js:1486:1)
    at DynamicRadar._measure (-private.js:1762:1)
    at DynamicRadar._updateIndexes (-private.js:1656:1)
    at DynamicRadar.update (-private.js:782:1)
    at -private.js:769:1
    at Array.execJob (index.js:36:1)
    at Scheduler.flush (index.js:96:1)
    at index.js:82:1

I'll try and follow-up with more details as I begin to investigate...

@wozny1989
Copy link

wozny1989 commented Jul 25, 2023

Anyone got an idea how to fix this? We have the same reason as @NullVoxPopuli to use shouldRecycle={{false}}

wozny1989 added a commit to alyne/vertical-collection that referenced this issue Jul 25, 2023
wozny1989 added a commit to alyne/vertical-collection that referenced this issue Jul 25, 2023
wozny1989 added a commit to alyne/vertical-collection that referenced this issue Jul 25, 2023
wozny1989 added a commit to alyne/vertical-collection that referenced this issue Jul 25, 2023
@NullVoxPopuli
Copy link

since I posted my comment, I've found that using derived data for everything solves most problems.

did-insert/did-update/will-destroy are problematic for more than just this scenario, but also outside of Ember. useEffect in React suffers from the same problem, as do other effect implementations in other frameworks, such as Preact, Solid, etc.

By using derived data, you appropriately get the correct behavior when you need it (when the root state changes, which is what happens during component re-use)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants