arco-design / arco-design-mobile

React mobile UI components library based on Arco Design
https://arco.design/mobile/react/arco-design/pc/#/
MIT License
397 stars 76 forks source link

Picker组件onOk函数回调没有返回默认值 #168

Open rockey2020 opened 12 months ago

rockey2020 commented 12 months ago

Basic Info

Steps to reproduce

<Picker visible={penisPickerVisible} cascade={false} data={[PenisOption]} maskClosable={true} onHide={() => { setPenisPickerVisible(false); }} value={value ? [value] : []} onOk={(item) => { console.log(item); setValue(item[0] as number); }} />

value为undefined的时候,显示picker,点击ok按钮,如果我没有上下滑动选择任何的item,这个时候onOk返回的是一个空数组,这里不应该是默认返回第一个item吗

rockey2020 commented 12 months ago
image image
TinaPeach commented 12 months ago

同学,该问题已复现,本周修复发版

TinaPeach commented 12 months ago

@arco-design/mobile-react@2.29.4已发版修复

rockey2020 commented 11 months ago

@TinaPeach 我这里测试看到还是返回了空数组

TinaPeach commented 11 months ago

@rockey2020 给下复现的地址或用法?我用上面的case是ok的。