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

    QPopupEdit double-click editing?

    Help
    4
    5
    512
    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.
    • X
      xzw168 last edited by

      QPopupEdit How to realize double-click editing?

      dobbel 1 Reply Last reply Reply Quote 0
      • dobbel
        dobbel @xzw168 last edited by dobbel

        @xzw168

        maybe you could use the @before-show event in QPopupEdit.

        1. In the event listener of @before-show you can check if the same event already occurred recently( what ever time you think is right for a double click).
        2. if this is false: prevent the event to bubble evt.stopPropagation() and set a state (to remember the click).
        3. if this is true: do nothing and the popup will show.
        M 1 Reply Last reply Reply Quote 0
        • A
          andrei94ro last edited by

          This is the only solution for this? i think it will be nicer if we can choose what event to use (click or double click). This will make things easier.

          M 1 Reply Last reply Reply Quote 0
          • M
            MiquelCapo @dobbel last edited by

            @dobbel this would be possible if the event is passed, but in quasar 2 there is no event…

            1 Reply Last reply Reply Quote 0
            • M
              MiquelCapo @andrei94ro last edited by

              @andrei94ro found this solution:

              //template
              
              '<div @click="parentClick" @dblclick="parentDblClick">
                <q-popup-edit></q-popup-edit>
              </div >
              '
              
               //setup
              return {
                parentDblClick:(e)=>{
              
                     //emit "click" event  with payload
                     e.target.dispatchEvent(new CustomEvent("click", {detail: 
                    {trigger:true}}))
              
                  },
              
                   parentClick:function (e, open){
                                      
                      //check payload and stop in current 
                           if(!e.detail?.trigger) e.stopPropagation()
                                  
                                      //keep event propagating on parent
                                       e.target.parentNode.dispatchEvent(new Event("click"))
              
              
                          },
              
              }
              
              
              
              1 Reply Last reply Reply Quote 0
              • First post
                Last post