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

Consider removing wrapper div of items #310

Open
inokawa opened this issue Jan 2, 2024 · 4 comments
Open

Consider removing wrapper div of items #310

inokawa opened this issue Jan 2, 2024 · 4 comments

Comments

@inokawa
Copy link
Owner

inokawa commented Jan 2, 2024

However, in current architecture, we can't assign ResizeObserver and position to items without it.

@inokawa
Copy link
Owner Author

inokawa commented Jan 5, 2024

As a workaround, you can override item prop of Virtualizer and use React.cloneElement in it.
https://github.com/inokawa/virtua/blob/main/stories/react/advanced/With%20cmdk.stories.tsx

It may be better to add a shorthand like <Virtualizer item={false}>. As an important point, without wrapper div, ResizeObserver doesn't detect border by default, and margin at all. We have to change configuration for it.

@wanecek
Copy link

wanecek commented Apr 11, 2024

Hi! Been struggling to find any list-virtualization plugin that allows this, so it'd be fantastic if virtua did. You mention that you can overwrite the itemprop on Virtualizer in React - is there a similar workaround for ListItem in the Vue implementation?

@inokawa
Copy link
Owner Author

inokawa commented Apr 11, 2024

Hello @wanecek ,
Vue Virtualizer doesn't have item prop yet but it would be possible to implement the feature.
Currently I don't have time to do it, but contribution is welcome if anyone want to help.

@inokawa
Copy link
Owner Author

inokawa commented Apr 24, 2024

React 19 will have ref cleanup function. I'll try it after release.

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

No branches or pull requests

2 participants