Skip to content
New issue

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

When mouse used to select value in Select, TreeSelect, Cascader or DatePicker the in Modal's Form the Modal get closed. #27208

Closed
1 task done
yurib opened this issue Oct 17, 2020 · 1 comment

Comments

@yurib
Copy link

yurib commented Oct 17, 2020

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

1 "New Collection" button
2 observe modal form pop-up
3 use mouse to make a chose in City, TreeSelect,Cascader or DatePicker
4 observe premature form closing

What is expected?

The form should stay until the modal window gets closed or the form canceled or submitted.

What is actually happening?

The form gets closed preventing from filling it up completely

Environment Info
antd 4.7.0
React 16.13.1
System MacOS 10.14.6, Windows 2016
Browser Chrome V:86.0.4240.80, Safary V14.0 (14610.1.28.1.10), Edge V:85.0.564.63

There was a similar issue before #12294, but no resolution found.
The problem looks like in the logic for rc-dialog package:

onWrapperClick = function onWrapperClick(e) {
      if (!contains(contentRef.current.getDOM(), e.target)) {
        onInternalClose(e);
      }
    };

Wrongly detect close event since dropdown element of the form input doesn't lay inside the DOM of the form

@afc163
Copy link
Member

afc163 commented Oct 18, 2020

This bug is been fixed in react-component/dialog#204: https://codesandbox.io/s/antd-reproduction-steps-forked-3m26o?file=/index.js

Please remove package-lock.json or yarn.lock and reinstall node_modules, make sure rc-dialog@8.4.2 installed.

@afc163 afc163 closed this as completed Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants