Closed homersimpsons closed 1 year ago
A call to scrollToItem require the user to set a value for gridItems:
scrollToItem
gridItems
https://github.com/Akryum/vue-virtual-scroller/blob/86fa98fd899487795b2d3c58d0486437d71c6892/packages/vue-virtual-scroller/src/components/RecycleScroller.vue#L681-L689
Doing so, the library set a width to the items in px and that is by default the same as the itemSize:
px
itemSize
https://github.com/Akryum/vue-virtual-scroller/blob/86fa98fd899487795b2d3c58d0486437d71c6892/packages/vue-virtual-scroller/src/components/RecycleScroller.vue#LL35C2-L35C11
This breaks list where the item width is 100%
<template> <div id="app"> <RecycleScroller :items="items" v-slot="{ item }" :grid-items="1" :item-size="20" > <div height="20">{{ item.id }} This takes more than 20px witdh</div> </RecycleScroller> </div> </template> <script> export default { setup() { return { items: [...Array(1000).keys()].map((x) => ({ id: x })), }; }, }; </script>
https://stackblitz.com/edit/vue-zcyqsm?file=src/App.vue
NA (stackblitz)
yarn
Hello, when will the fix version for this issue be released, components that depend on this will not work properly for now .Thank you for your reply.
Describe the bug
A call to
scrollToItem
require the user to set a value forgridItems
:https://github.com/Akryum/vue-virtual-scroller/blob/86fa98fd899487795b2d3c58d0486437d71c6892/packages/vue-virtual-scroller/src/components/RecycleScroller.vue#L681-L689
Doing so, the library set a width to the items in
px
and that is by default the same as theitemSize
:https://github.com/Akryum/vue-virtual-scroller/blob/86fa98fd899487795b2d3c58d0486437d71c6892/packages/vue-virtual-scroller/src/components/RecycleScroller.vue#LL35C2-L35C11
This breaks list where the item width is 100%
Reproduction
https://stackblitz.com/edit/vue-zcyqsm?file=src/App.vue
System Info
Used Package Manager
yarn
Validations