GithubHelp home page GithubHelp logo

Comments (4)

johndatserakis avatar johndatserakis commented on May 31, 2024 1

Hi there @nickmarkfurness, hmm I see what you're saying. Yea it seems like in some cases, on certain layers, like modals or other overlays, there is an issue with the positioning. Issue #8 also has a bit of discussion around this.

I like the idea of allowing the ability to optionally attach to an element. I'll take a stab at getting that done as soon as I have some time coming up. Thank you.

from vue-simple-context-menu.

nickmarkfurness avatar nickmarkfurness commented on May 31, 2024 1

My work around is to get the div and append to the body tag on the on mounted() event. This seems to work fine for me so far ...
The mouse co-ords work on the view port of the page so maybe this is done no matter what??
I have yet to check if moving it stops Vue from any potential cleanup issue and if i need to do this on the beforeDestroy() event

from vue-simple-context-menu.

rttmax avatar rttmax commented on May 31, 2024 1

For me the problem was caused by css-transformed parent-elements.
I'm creating the menus dynamically when they are needed and append the markup directly to the body to get over this.

   handleContextMenu(e, i) {
      const ComponentClass = Vue.extend(VueSimpleContextMenu)
      const instance = new ComponentClass({
        store: this.$store,
        propsData: {
          ref: 'contextMenu',
          elementId: 'contextMenu',
          options: [
            {
              name: 'use',
              slug: 'use'
            }, ...
          ]
        }
      })
      instance.$on('menu-closed', () => {
        instance.$destroy()
        instance.$el.parentNode.removeChild(instance.$el)
      })
      instance.$mount()
      document.body.appendChild(instance.$el)
      instance.showMenu(e, i)
    }

Because I need to delete and destroy the component after use I added the 'menu-closed'-event.

from vue-simple-context-menu.

johndatserakis avatar johndatserakis commented on May 31, 2024

Closing for now, will open again if needed.

from vue-simple-context-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.