-
Notifications
You must be signed in to change notification settings - Fork 939
feat(ScrollArea): new component #5245
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
base: v4
Are you sure you want to change the base?
Conversation
|
|
| </template> | ||
|
|
||
| <template v-else-if="items?.length"> | ||
| <slot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure defining a default slot multiple times works here π€
|
Ah sorry @benjamincanac - didnt mean for you to spend time reviewing yet, I was just excited about the demo π |
|
Yeah don't worry I just took a quick look at it π The demo is really cool! |
|
I'd love to see skeleton support for something like this! I was implementing a scrollable component that Loving the demo by the way! πͺπ» |
A lot of the rendering time is taken up by the height calculation, if you have a consistent row height - using the correct estimate size improves the scrolling empty state a lot. I dont see support for a loading/skeleton state in tanstack virtual. There is a check for is scrolling, I will try to expose this and you could could show some kind of skeleton, otherwise if you're dynamically calling data on render, you would need to implement a loading state inside your row. @alliecatowo If you find any helpful references please link them, I would love to solve this also. |
commit: |
|
@benjamincanac I've gotten pretty far, and i've got it working inside the blogposts component. I could probably use feedback at this point before going further. |
benjamincanac
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikenewbon I've pushed a few changes to clean things up a bit, hopefully I didn't mess anything. Would you mind having a look and letting me know what you think?
Is there a reason the Infinite scroll and Masonry layout sections in the docs don't have examples? π€
|
Thanks @benjamincanac - looking great! Will take a proper look later at the playground but docs is much better. Masonry layout section was reworked after I removed the resize observer, could probably be retitled to 'Responsive Lanes' as variable heights section covers masonry. Load more, I will make a nice example tonight and share. Does a local example just generating new items on call work or should I find an public paginated api? |
|
As you prefer both solutions work, there's an example on the Table that uses a public API though: https://ui.nuxt.com/docs/components/table#with-infinite-scroll |
|
@benjamincanac - fixed a couple of visual bugs in horizontal layout in the playground and the changes in docs discussed, let me know if you have feedback you'd like me to implement or feel free to make further changes yourself! Thanks bud π |
benjamincanac
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikenewbon I'm hesitant to merge this because it confuses me to have to define padding and gap using the virtualize object, it should work out of the box like virtualize props on other components π€
|
@benjamincanac - i've added default values which should mean the virtual/nonvirtual views are consistent by default without overrides and |

π Linked issue
Resolves #5201
β Type of change
π Description
An implementation of a flexible, multi-column, vertical/horizontal scroll-area component using Tanstack virtual.
π Checklist