From 2ca38b791827d6bf661be741a51d89aa4e26c753 Mon Sep 17 00:00:00 2001 From: dolymood Date: Tue, 28 Apr 2020 19:14:38 +0800 Subject: [PATCH] refactor(picker): selectedIndex computed logic --- src/components/picker/picker.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/picker/picker.vue b/src/components/picker/picker.vue index 16d7aa04..19611636 100644 --- a/src/components/picker/picker.vue +++ b/src/components/picker/picker.vue @@ -236,12 +236,12 @@ useTransition: USE_TRANSITION }) wheel.on('scrollEnd', () => { - const y = wheel.y let selectedIndex if (USE_TRANSITION) { selectedIndex = wheel.getSelectedIndex() } else { // fixed BScroll not calculating selectedIndex when setting useTransition to false + const y = wheel.y if (y > wheel.minScrollY) { selectedIndex = 0 } else if (y < wheel.maxScrollY) { -- GitLab