提交 2ca38b79 编写于 作者: D dolymood

refactor(picker): selectedIndex computed logic

上级 66757b88
...@@ -236,12 +236,12 @@ ...@@ -236,12 +236,12 @@
useTransition: USE_TRANSITION useTransition: USE_TRANSITION
}) })
wheel.on('scrollEnd', () => { wheel.on('scrollEnd', () => {
const y = wheel.y
let selectedIndex let selectedIndex
if (USE_TRANSITION) { if (USE_TRANSITION) {
selectedIndex = wheel.getSelectedIndex() selectedIndex = wheel.getSelectedIndex()
} else { } else {
// fixed BScroll not calculating selectedIndex when setting useTransition to false // fixed BScroll not calculating selectedIndex when setting useTransition to false
const y = wheel.y
if (y > wheel.minScrollY) { if (y > wheel.minScrollY) {
selectedIndex = 0 selectedIndex = 0
} else if (y < wheel.maxScrollY) { } else if (y < wheel.maxScrollY) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册