No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Context-menu on nested elements

    Help
    2
    4
    324
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      chyde90 last edited by

      Hi,

      I want to have different context menus based on what the user clicked on in a hierarchy of elements.
      More precisely, I need a context menu for individual elements and for the background / the container (it’s for a file-explorer).

      In Quasar 0.17 I did it like this: https://jsfiddle.net/Lwz8pj34/3/
      It works as expected: When I right-click on the container, the parent context menu opens, and when I right-click on the child element, the child context menu shows instead.

      But after my v1 upgrade, this doesn’t work anymore, see: https://jsfiddle.net/e71dfcxL/ (version: 1.1.6)
      The parent context menu is always opening regardless on which element I click.

      Am I doing something wrong?
      Or is this maybe a bug?

      1 Reply Last reply Reply Quote 0
      • C
        chyde90 last edited by

        I noticed that actually both context menus are opening ontop of each other.
        So I think this is a bug.

        Is there a way to stop the right-click event and the long-click event (on mobile) on the inner QMenu?
        Otherwise I’ll have to work with mouse-enter events or something and disable one menu programatically and hope for a fix

        1 Reply Last reply Reply Quote 0
        • metalsadman
          metalsadman last edited by

          @chyde90 see @pdanpdan 's answer/codepen here https://github.com/quasarframework/quasar/issues/5135.

          C 1 Reply Last reply Reply Quote 0
          • C
            chyde90 @metalsadman last edited by

            @metalsadman Awesome! This works for me. Thanks alot!
            Next time I’ll check the issues, too 🙂

            1 Reply Last reply Reply Quote 0
            • First post
              Last post