We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://github.com/supper1/antd-m.git
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 (
export default App;
在组件重新渲染时,不影响组件的选择
页面重新渲染会导致选项回弹无法正常使用
The text was updated successfully, but these errors were encountered:
一样的问题,触发条件:hooks组件、setInterval(比如页面有倒计时功能)、加入picker,在打开picker之前,先触发setInterval,再打开picker、选择就有问题了
Sorry, something went wrong.
v2 已经停止维护了,建议升级到 v5 吧
Successfully merging a pull request may close this issue.
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?
页面重新渲染会导致选项回弹无法正常使用
The text was updated successfully, but these errors were encountered: