fix(Calendar): scrollIntoView error when hidden (#5708)

This commit is contained in:
陈嘉涵 2020-02-22 14:42:09 +08:00
parent b705b7a58e
commit 7cc887a20c

View File

@ -166,9 +166,10 @@ export default createComponent({
this.$nextTick(() => { this.$nextTick(() => {
const { currentDate } = this; const { currentDate } = this;
const targetDate = this.range ? currentDate[0] : currentDate; const targetDate = this.range ? currentDate[0] : currentDate;
const displayed = this.value || !this.poppable;
/* istanbul ignore if */ /* istanbul ignore if */
if (!targetDate) { if (!targetDate || !displayed) {
return; return;
} }