-
-
Notifications
You must be signed in to change notification settings - Fork 306
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
feat: add isScrollingResetDelay option to Virtualizer #719
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit d7d7111. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
22dfe54
to
ecd788b
Compare
ecd788b
to
d7d7111
Compare
Thanks for this! |
Hey @piecyk The code below doesn't seem to work because
This code does work but it causes the whole virtualizer to re-initialize which causes a flicker on and off.
Do you know how I can get the virtualizer to get the correct value without re-initializing? Thanks! |
I see the issue, i think you can lift the safari up to global context as a method, then you don't really need an effect and ssr hydration should also work correctly const isSafari = () =>
typeof window !== 'undefined' &&
Boolean((window as unknown as { safari: object }).safari)
const Foo () => {
const virtualizer = useVirtualizer({
count: COUNT,
getScrollElement,
estimateSize: useCallback((index) => sizes[index], [sizes]),
horizontal: true,
initialOffset: 0,
initialRect: { width: 2500, height: 2500 },
overscan: 3,
isScrollingResetDelay: isSafari() ? 1100 : undefined,
})
} |
No description provided.