Coder Social home page Coder Social logo

Comments (4)

rodneyrehm avatar rodneyrehm commented on May 25, 2024

While I agree with your assessment, I (currently) don't see any reliable way to implement it.

Whenever a menu is shown, a transparent layer is put behind it. This layer is supposed to guarantee that a click anywhere outside of the menu would either close or reposition the menu. I would've preferred to bind an event to document and act from there. While that approach worked fine for me, other people had quite the difficulties with other widgets on their site (namely if the widgets stopPropagation() of certain events). This layer is the reason why your second table row never receives the click.

We could introduce an option that lets you enable/disable the layer thing. So the safe option would be to use the layer and not care about what other widgets on the page do. Disabling the layer would lead to binding a mousedown event to document to hide the menu when necessary. Should a menu be open and one clicked on another widget, this event handler might never be executed. It would be the responsibility of the implementor to make sure menus close when they need to.

If this solution is something you can work with, I would look into it "soon".

from jquery-contextmenu.

cantonic avatar cantonic commented on May 25, 2024

Yeah, i think there is no other way of implementing this than introducing an option to enable/disable the layer stuff. It would be great if you could implement that ;)

from jquery-contextmenu.

rodneyrehm avatar rodneyrehm commented on May 25, 2024

I looked into this more closely. Apparently I will not be able to get rid of the backdrop-layer that easily.
Instead I would try to use document.elementFromPoint (spec) to find out if you clicked on another triggering element. This will not work in older browsers - but it won't break them either.

from jquery-contextmenu.

rodneyrehm avatar rodneyrehm commented on May 25, 2024

Implemented and released in version 1.5.15. You only have to update the source, no furthor action required :)

from jquery-contextmenu.

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.