ZhongAnTech / zarm

基于 React 的移动端 UI 组件库
https://zarm.design
MIT License
1.71k stars 225 forks source link

Popup 组件内部嵌套 Radio 组件,关闭动画异常 #1154

Closed LentoYe closed 11 months ago

LentoYe commented 11 months ago

Description

Popup 组件内部嵌套 Radio 组件,Radio 组件可以控制Popup 的关闭,然而 Radio 的onChange 事件绑定控制Popup 关闭的方法后,Popup 关闭的动画消失,形成闪退的效果。

Steps to Reproduce

const [popupVisible, setPopupVisible] = false;

<Popup animationDuration={500} visible={popupVisible} onMaskClick={() => setPopupVisible(false)} destroy={false}>
  <NavBar right={<Close theme="primary" onClick={() => setPopupVisible(false)} />} />  // 关闭动画正常
  <Radio.Group 
    type="list" 
    listIconAlign="after" 
    value={paymentChosen.paymentWay} 
    onChange={() => setPopupVisible(false)}  // 关闭动画异常
  >
    {
      paymentList.map((item) => {
        return <Radio data={item} />;
      })
    }
  </Radio.Group>
</Popup>

Environment

You can get this information from package.json and your device.