Giter Site home page Giter Site logo

Comments (8)

isaacplmann avatar isaacplmann commented on May 21, 2024

The context menu tries to orient itself so that it doesn't flow off the side of screen (if possible). The first orientation it tries is to put the top left corner of the context menu at the mouse location. Can you give me more details about your app?

  1. What does the event object look like?
  2. Are you doing any styling using the position css property?

from ngx-contextmenu.

GabrielSiq avatar GabrielSiq commented on May 21, 2024

Thanks for answering so quickly.

  1. Would you like to see an example of generated MouseEvent object?
  2. I haven't applied any custom styling to this component or any other yet.

from ngx-contextmenu.

isaacplmann avatar isaacplmann commented on May 21, 2024
  1. Yes.

from ngx-contextmenu.

GabrielSiq avatar GabrielSiq commented on May 21, 2024

image
image

from ngx-contextmenu.

isaacplmann avatar isaacplmann commented on May 21, 2024

In your console, enter document.body.clientWidth and document.body.clientHeight and let me know what they say.

from ngx-contextmenu.

GabrielSiq avatar GabrielSiq commented on May 21, 2024

Width returned 1060, Height returned 10

PS My app has a component that contains a D3.js graph in which I included context menus in the nodes like in the issue I opened a while ago. That context menu also opens from the bottom left corner.

from ngx-contextmenu.

isaacplmann avatar isaacplmann commented on May 21, 2024

The height is the problem. The context menu thinks it only has 10px of height to work with and is trying to show as much of the context menu as possible in those 10px. Giving your body a min-height in css will fix the problem, but I'm guessing there is some underlying issue that is stopping your body from knowing its real height. Are you using float based layout? Adding a clearfix at the end of the body would help that situation.

from ngx-contextmenu.

GabrielSiq avatar GabrielSiq commented on May 21, 2024

clearfix solved it! Thanks!

from ngx-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.