Compare commits

..

No commits in common. "04494a450d41ae7c68a2ecbc61b218c2fb574e26" and "7eaefd04fac0f2a188d9386ea677379ead61e903" have entirely different histories.

2 changed files with 5 additions and 10 deletions

View File

@ -185,6 +185,10 @@ export default defineComponent({
const months: Date[] = [];
const cursor = new Date(props.minDate);
if (props.lazyRender && !props.show && props.poppable) {
return months;
}
cursor.setDate(1);
do {
@ -295,9 +299,7 @@ export default defineComponent({
props.type === 'single'
? (currentDate.value as Date)
: (currentDate.value as Date[])[0];
if (isDate(targetDate)) {
scrollToDate(targetDate);
}
scrollToDate(targetDate);
} else {
raf(onScroll);
}

View File

@ -1,6 +1,5 @@
import { useRect } from '@vant/use';
import { Ref, ref, onMounted, nextTick } from 'vue';
import { onPopupReopen } from './on-popup-reopen';
export const useHeight = (
element: Element | Ref<Element | undefined>,
@ -26,11 +25,5 @@ export const useHeight = (
}
});
// The result of useHeight might be 0 when the popup is hidden,
// so we need to reset the height when the popup is reopened.
// IntersectionObserver is a better solution, but it is not supported by legacy browsers.
// https://github.com/vant-ui/vant/issues/10628
onPopupReopen(() => nextTick(setHeight));
return height;
};