ant-design / ant-design

An enterprise-class UI design language and React UI library
https://ant.design
MIT License
92.12k stars 49.27k forks source link

After adding transitionName, modal will not closed properly #44099

Closed MarcusCody closed 1 year ago

MarcusCody commented 1 year ago

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Add transitionName to modal as a props

What is expected?

The modal should be closed along with its mask and the modal box

What is actually happening?

The modal is not closed after clicking the close button or the masking area, but the mask will be closed after clicking to closing button or mask area.

It is weird that I have a modal with my own defined transitionName that will be able to close the modal along with its mask, but I have another similar modal on another page, it will not close the modal but it will just close its masking. I am using the same transition className for both of these modals, one works but another won't work.

This is the class name I used for both modals. .purchase-order-form-modal-container { transition: none !important; animation-duration: 0s !important; }

Even I try to use the transitionName set to transitionName = "test" it is still not working properly, the modal will not close after giving it the transitionName props

I am having a similar issue #29626, I tried using the transitionName = 'ant-move-down' but I do not want the transition effect

Environment Info
antd 5.7.0
React 18.2.0
System Version 10.0.22621 Build 22621
Browser Version 115.0.5790.110 (Official Build) (64-bit)
zombieJ commented 1 year ago

transitionName is what it mean need transition which will hide modal by onTransitionEnd event. If you dont want motion, just use ConfigProvider to disable it:

https://ant.design/docs/react/customize-theme#disable-motion