Skip to content

Commit

Permalink
feat: 解决picker在pc端虚拟touch的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kongjing@dian.so authored and kongjing@dian.so committed Nov 30, 2022
1 parent ccceec7 commit 34084c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/vantui/src/picker-column/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ function Index(
options.length - 1,
)
setIndex(index, true)
if (isMoving.current) isMoving.current = false
nextTick(() => {
if (isMoving.current) isMoving.current = false
})
},
[startOffset, offset, itemHeight, options.length, setIndex],
)
Expand All @@ -139,9 +141,7 @@ function Index(
function (event) {
const { index } = event.currentTarget.dataset
if (!isMoving.current) {
setTimeout(() => {
setIndex(Number(index), true)
}, 100)
setIndex(Number(index), true)
}
},
[setIndex],
Expand Down

0 comments on commit 34084c8

Please sign in to comment.