You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you pass mousePosition prop to a modal component you can see that it is not applied. In the case of a null value assigned to mousePosition, the animation should not appear.
What is expected?
mousePosition is respected as is laid out in the react-component/dialog documentation. As a user you should be able to set it to null if you do not wish for mousePosition to be used. The animation should be optional, but currently is forced for every modal opening based on the users mouse position coordinates.
What is actually happening?
Since specification order is important when using the spread operator, the later mousePosition prop overrides the previous one if passed in as a prop (see ...restProps) to the modal.
Version
3.8.1
Environment
Latest Chrome, MacOS, React.
Reproduction link
https://codepen.io/anon/pen/mjYJJw?editors=001
Steps to reproduce
If you pass mousePosition prop to a modal component you can see that it is not applied. In the case of a null value assigned to mousePosition, the animation should not appear.
What is expected?
mousePosition is respected as is laid out in the react-component/dialog documentation. As a user you should be able to set it to null if you do not wish for mousePosition to be used. The animation should be optional, but currently is forced for every modal opening based on the users mouse position coordinates.
What is actually happening?
Since specification order is important when using the spread operator, the later mousePosition prop overrides the previous one if passed in as a prop (see ...restProps) to the modal.
https://github.com/ant-design/ant-design/blob/master/components/modal/Modal.tsx
The text was updated successfully, but these errors were encountered: