Comments (6)
I just did some more experimenting, I think the problem only occurs when animate: false
. I think the menu closing animation is providing enough time for the menu item's onClick
handler to fire. Without the animation, the DOM element with the click handler is removed before the event can fire.
from react-dd-menu.
Hmm, lemme look through this code for a bit. I haven't actively worked on this package for about a year, so I'm a bit hazy. You can always set the prop closeOnInsideClick: false
which would prevent the autoclose feature when clicking any of these list items. It would then rely on every one of a
to also call your function to close the menu.
The timeouts of 1
feel like a kind of hack to me, I'd like to find the base problem in my code first if possible.
from react-dd-menu.
Hmm, do you have a code snippet you can send me? It appears to be working correctly from my Examples.
from react-dd-menu.
Sure, it's embedded in my project's codebase, so I'll have to break it out when I have some time. Feel free to close the issue in the meantime.
Oh, and thanks for the quick response!
from react-dd-menu.
Note: Setting leaveTimeout
and enterTimeout
both to 1
, and enabling the animation, gets it to work, but without a visible animation. Maybe have animate: false
just set those two values to 1
and call it a day? Let me know if you want a PR.
from react-dd-menu.
Ok, I don't think there is any way around the timeout issue. I'd be good with accepting a PR for it. Otherwise I'll try to get to it later this week.
from react-dd-menu.
Related Issues (20)
- Fix Exports for ES5 People. HOT 1
- Add Touch/Click Support for Nested Dropdown Menu
- Add a Delay to NestedDropdownMenu blur/leave
- Handle Multiple Nested Menus Closing at the Same TIme (Animated Only) HOT 1
- Allow disabling animation for the main dropdown menu
- Checkbox Functionality? HOT 1
- Update to react 15 HOT 3
- Replace PureRenderMixin with PureComponent HOT 3
- NestedDropdownMenu can't close when i clicked the menu item HOT 3
- controlling left\right icon HOT 4
- DD menu is going off screen HOT 1
- Open menu at the click location HOT 3
- Multiple dropdowns on a page
- onClick event not triggered HOT 2
- Invoke `props.close` on unmount HOT 1
- How to deal with dropdown being hidden HOT 1
- Preventing nested menu from opening on click HOT 2
- Align property does not work HOT 2
- Dropdown with uncontrolled state
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-dd-menu.