Skip to content

Commit

Permalink
chore(Picker): fix 传入负数的处理
Browse files Browse the repository at this point in the history
  • Loading branch information
cuilanxin committed Oct 20, 2021
1 parent 91441c1 commit eca96cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/Picker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ const Picker = (props: PickerProps) => {
}, [current]);
useEffect(() => {
if (value !== current) {
const leng = value > date.length - 1 ? date.length - 1 : value;
let leng = value > date.length - 1 ? date.length - 1 : value;
leng = leng < 0 ? 0 : leng;
location((style.containerHeight as number) * (leng + 1), leng);
setCurrent(leng);
}
Expand Down

0 comments on commit eca96cf

Please sign in to comment.