Code Monkey home page Code Monkey logo

Comments (6)

JonAbrams avatar JonAbrams commented on June 26, 2024 1

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.

mlaursen avatar mlaursen commented on June 26, 2024 1

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.

mlaursen avatar mlaursen commented on June 26, 2024

Hmm, do you have a code snippet you can send me? It appears to be working correctly from my Examples.

from react-dd-menu.

JonAbrams avatar JonAbrams commented on June 26, 2024

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.

JonAbrams avatar JonAbrams commented on June 26, 2024

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.

mlaursen avatar mlaursen commented on June 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.