-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
react-component/m-picker
#261Description
- I have searched the issues of this repository and believe that this is not a duplicate.
Reproduction link
https://github.com/supper1/antd-m.git
Steps to reproduce
import React ,{useState} from 'react';
import { Picker, List } from 'antd-mobile';
import 'antd-mobile/dist/antd-mobile.css';
const seasons = [
[
{
label: '2013',
value: '2013',
},
{
label: '2014',
value: '20141',
},
{
label: '2014',
value: '20142',
},
{
label: '2014',
value: '20143',
},
{
label: '2014',
value: '20144',
},
{
label: '2014',
value: '20145',
},
{
label: '2014',
value: '20146',
},
],
[
{
label: '春',
value: '春',
},
{
label: '夏',
value: '夏',
},
],
];
function App() {
const [value,setValue] = useState('')
const [value2,setValue2] = useState(0)
setInterval(()=>{ // 存在持续渲染数据的时候picker组件会有回弹
setValue2(value2 1)
},500)
return (
<Picker
data={seasons}
title="选择季节"
cascade={false}
extra="请选择(可选)"
value={value}
onChange={v => setValue(v )}
onOk={v => setValue( v )}
>
<List.Item arrow="horizontal">Multiple</List.Item>
);
}
export default App;
What is expected?
在组件重新渲染时,不影响组件的选择
What is actually happening?
页面重新渲染会导致选项回弹无法正常使用
Environment | Info |
---|---|
antd | 2.3.0 |
React | react |
System | win10 |
Browser | Chrome 79.0.3945.117 |
Metadata
Metadata
Assignees
Labels
No labels