Skip to content

Commit e1613fa

Browse files
committed
fix: select not scroll, close #5082
1 parent 8b2b402 commit e1613fa

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

components/vc-virtual-list/Item.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import type { FunctionalComponent, PropType } from 'vue';
22
import { cloneVNode } from 'vue';
3+
import { flattenChildren } from '../_util/props-util';
34

45
export interface ItemProps {
56
setRef: (element: HTMLElement) => void;
67
}
78

89
const Item: FunctionalComponent<ItemProps> = ({ setRef }, { slots }) => {
9-
const children = slots.default?.();
10+
const children = flattenChildren(slots.default?.());
1011

1112
return children && children.length
1213
? cloneVNode(children[0], {

components/vc-virtual-list/List.tsx

-9
Original file line numberDiff line numberDiff line change
@@ -224,15 +224,6 @@ const List = defineComponent({
224224
if (!useVirtual.value || !inVirtual.value) {
225225
return;
226226
}
227-
if (!inVirtual.value) {
228-
Object.assign(calRes, {
229-
scrollHeight: offsetHeight.value,
230-
start: 0,
231-
end: mergedData.value.length - 1,
232-
offset: undefined,
233-
});
234-
return;
235-
}
236227

237228
let itemTop = 0;
238229
let startIndex: number | undefined;

0 commit comments

Comments
 (0)