QPopupEdit double-click editing?
-
QPopupEdit How to realize double-click editing?
-
maybe you could use the
@before-show
event in QPopupEdit.- 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). - if this is false: prevent the event to bubble
evt.stopPropagation()
and set a state (to remember the click). - if this is true: do nothing and the popup will show.
- In the event listener of
-
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.
-
@dobbel this would be possible if the event is passed, but in quasar 2 there is no event…
-
@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")) }, }