Akryum / vue-virtual-scroller

⚡️ Blazing fast scrolling for any amount of data
https://vue-virtual-scroller-demo.netlify.app
9.74k stars 914 forks source link

Dynamic scroller not handling correct position #791

Open zsqio opened 1 year ago

zsqio commented 1 year ago

Describe the bug

elements are shown and overlap other items

Reproduction

<template>
    <div>
        <DynamicScroller
            ref="chatScroll"
            :items="chatMsgList"
            class="chat-scroller"
            :min-item-size="50"
            @resize="scrollToEnd"
            @scroll.native.passive="handleScroll"
        >
            <template v-slot="{item, index, active}">
                <DynamicScrollerItem
                    :item="item"
                    :data-index="index"
                    :active="active"
                    :data-active="active"
                >
                    <div class="message-item" v-html="item.content"></div>
                </DynamicScrollerItem>
            </template>
         </DynamicScroller>
    </div>
</template>
<script>
export default {
    computed: {
        chatMsgList() {
            let list = this.$store.state.chat.chatMsgList;
            if (list.length > 200) {
                const num = list.length - 200;
                list.splice(0, num);
            }
            list = list.map((item, index) => {
                return {
                    id: index++,
                    content: item
                };
            });
            return list;
        }
    }
}
</script>

System Info

"vue": "^2.5.17",
"vue-virtual-scroller": "^1.1.2",

Used Package Manager

npm

Validations

mateusmsant commented 1 year ago

I'm having the same issue. It's sad that the best lib for vue virtual scrolling is abandoned xD

varna commented 1 year ago

Yeah... Tried adding a Popover inside and it broke down:

image
lizyChy0329 commented 8 months ago

Complain to the Vue team?