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

Trigger recalculation on every update when not scrolling #414

Merged
merged 1 commit into from
Nov 7, 2022

Conversation

piecyk
Copy link
Collaborator

@piecyk piecyk commented Oct 25, 2022

fixes #363

suppress #403

@piecyk piecyk requested a review from tannerlinsley October 25, 2022 17:01
@@ -391,7 +413,7 @@ export class Virtualizer<TScrollElement = unknown, TItemElement = unknown> {
},
)

private calculateRange = memo(
calculateRange = memo(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ecstatic that you are trying to solve this, because my team recently just ran head first into this exact issue. My main question with this approach, I think, is why can't we just have measure (which is already public) call calculateRange as part of its implementation. At the moment, it already doesn't seem to be doing what it semantically says it should be doing (from what I can tell{).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, i think we need to re-thing measure, now it's only clears itemMeasurementsCache and trigger update so most cases it will not measure anything. When we merge #405 with adding support observing elements with ResizeObserver i think we could drop it.

kuanoni added a commit to kuanoni/react-security-badging-system that referenced this pull request Nov 4, 2022
@piecyk piecyk force-pushed the fix/calc-range-when-not-scrolling branch from ae755a7 to c1049e3 Compare November 7, 2022 19:00
@piecyk piecyk force-pushed the fix/calc-range-when-not-scrolling branch from c1049e3 to 57f225c Compare November 7, 2022 19:11
@piecyk piecyk merged commit be7329f into TanStack:beta Nov 7, 2022
@piecyk piecyk deleted the fix/calc-range-when-not-scrolling branch November 7, 2022 19:13
kuanoni added a commit to kuanoni/react-security-badging-system that referenced this pull request Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamically updating count seems to not trigger an update
2 participants