From 8b515a8c2bb566a965da313def2206dd38ef5d79 Mon Sep 17 00:00:00 2001 From: zijiecai <61113647+zijiecai@users.noreply.github.com> Date: Mon, 17 Oct 2022 23:26:24 +0800 Subject: [PATCH] fix(Calendar): throw an error that scrollTop in undefined when poppable in popup (#11140) --- src/calendar/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calendar/index.js b/src/calendar/index.js index 2bb0f8c0e..988f9b8fb 100644 --- a/src/calendar/index.js +++ b/src/calendar/index.js @@ -172,7 +172,9 @@ export default createComponent({ mounted() { this.init(); // https://github.com/vant-ui/vant/issues/9845 - this.vanPopup?.$on('opened', this.onScroll); + if (!this.poppable) { + this.vanPopup?.$on('opened', this.onScroll); + } }, /* istanbul ignore next */