fix: select not scroll, close #5082

pull/5084/head
tangjinzhou 2021-12-27 15:40:48 +08:00
parent 8b2b402f73
commit e1613fa9d4
2 changed files with 2 additions and 10 deletions

View File

@ -1,12 +1,13 @@
import type { FunctionalComponent, PropType } from 'vue';
import { cloneVNode } from 'vue';
import { flattenChildren } from '../_util/props-util';
export interface ItemProps {
setRef: (element: HTMLElement) => void;
}
const Item: FunctionalComponent<ItemProps> = ({ setRef }, { slots }) => {
const children = slots.default?.();
const children = flattenChildren(slots.default?.());
return children && children.length
? cloneVNode(children[0], {

View File

@ -224,15 +224,6 @@ const List = defineComponent({
if (!useVirtual.value || !inVirtual.value) {
return;
}
if (!inVirtual.value) {
Object.assign(calRes, {
scrollHeight: offsetHeight.value,
start: 0,
end: mergedData.value.length - 1,
offset: undefined,
});
return;
}
let itemTop = 0;
let startIndex: number | undefined;