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

Click Menu item will close DropDown #12420

Closed
1 task done
JHanLu opened this issue Sep 26, 2018 · 11 comments
Closed
1 task done

Click Menu item will close DropDown #12420

JHanLu opened this issue Sep 26, 2018 · 11 comments
Assignees

Comments

@JHanLu
Copy link

JHanLu commented Sep 26, 2018

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

Version

3.9.3

Environment

windows10, Chrome 62

Reproduction link

https://codepen.io/JHanLu/pen/YOmvGr?&editors=001

Steps to reproduce

I put a search input in Menu item in dropDown overlay, when I click the search input in menu, dropDown menu will be closed. When I do something like preventDefault in Menu, it show event.preventDefault is undefined.

What is expected?

I want to click the Menu without closing dropDown.

What is actually happening?

When I click the menu item, dropDown closed immediately.

@picodoth
Copy link
Contributor

please refer this example: https://codepen.io/pen/?&editors=001

@JHanLu
Copy link
Author

JHanLu commented Sep 27, 2018

@picodoth Your example is empty.

@picodoth
Copy link
Contributor

woops, my bad: https://codesandbox.io/s/k5v3yjzwrv

@JHanLu
Copy link
Author

JHanLu commented Sep 27, 2018

Thanks! Been struggled for a long time.

@JHanLu
Copy link
Author

JHanLu commented Oct 31, 2018

@picodoth New problem here. Click SubMenu will close SubMenu and DropDown, your solution didn't work in this case.
see: https://codepen.io/JHanLu/pen/YOmvGr?editors=0010

@picodoth
Copy link
Contributor

picodoth commented Nov 1, 2018

@JHanLu
you have to manually stop event bubbling: https://codepen.io/anon/pen/KGOapo?editors=0010

@JHanLu
Copy link
Author

JHanLu commented Nov 1, 2018

@picodoth Thank u so much! I could have tried it. 😅

@mahyalpr
Copy link

I have a problem. i set the input into dropdown , I used visible an onvisiblechange , it works, but i cant write anything in input !!!!!!!!!!!!!!!!!!!!!!

@arnav-dt
Copy link

arnav-dt commented Jul 21, 2021

woops, my bad: https://codesandbox.io/s/k5v3yjzwrv

Update 2021: Fix antd imports to

import Dropdown from 'antd/lib/dropdown'; import Icon from 'antd/lib/icon'; import Menu from 'antd/lib/menu';

to get the codesandbox working

@muslimr
Copy link

muslimr commented Sep 22, 2021

woops, my bad: https://codesandbox.io/s/k5v3yjzwrv

this page doesn't work correctly man )

@saikrishnabanda5
Copy link

THis is empty

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

7 participants