You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have encountered an unexpected side-effect of the left-click handling in the code: we have a trigger button inside a slick-grid table structure, our slick-grid cells have a handler for onContextMenu and we are now facing a major issue with the trigger button! it's calling the slick-grid handler instead of calling the contextMenu creator.
following GIF shows the issue. the yellow clicks are left-click, the red ones are right-click...
reason for it is the code below. clicking the trigger button is calling the contextMenu event, which in return triggers the onContextMenu function defined later on in our slick-grid section.
any suggestions how to avoid this?
one solution is to detect that the onContextMenu was triggered artificially in the slick-grid code and not to continue that function. this would require that the code knows that the trigger (event target) is a contextMenu object. I have not been able to find any plugin command or helper which would facilitate this.
another and well, a better solution is to rewrite the code below to avoid calling contextMenu event! technically, it should be possible to define 2 different sets of actions for left-clicking or right-clicking an element and this piece of code is forbidding it...
PS: I used $.contextMenu.menus to check if the event target is one of the contextMenu selectors, partially implementing my first solution, but now there is another issue. I cannot determine in my slick-grid code if I have right-clicked or left-clicked on the button (code posted below).
as I have seen in the code, there are 4 code parts which actually trigger the contextmenu: handlers for click, mouseup, mouseenter and on line 1621 which I honestly don't understand.
I supposeif the "original" event was passed as an argument of the new event, it would have been possible to determine in my slick-grid side of the code what the real called event used as trigger (left, mouseenter, mouseup etc.). something like $.Event('contextmenu', {data: e.data, pageX: e.pageX, pageY: e.pageY, originalEvent: e})
I have encountered an unexpected side-effect of the left-click handling in the code: we have a trigger button inside a slick-grid table structure, our slick-grid cells have a handler for
onContextMenu
and we are now facing a major issue with the trigger button! it's calling the slick-grid handler instead of calling thecontextMenu
creator.following GIF shows the issue. the yellow clicks are left-click, the red ones are right-click...
reason for it is the code below. clicking the trigger button is calling the
contextMenu
event, which in return triggers theonContextMenu
function defined later on in our slick-grid section.any suggestions how to avoid this?
onContextMenu
was triggered artificially in theslick-grid
code and not to continue that function. this would require that the code knows that the trigger (event target) is acontextMenu
object. I have not been able to find any plugin command or helper which would facilitate this.contextMenu
event! technically, it should be possible to define 2 different sets of actions for left-clicking or right-clicking an element and this piece of code is forbidding it...The text was updated successfully, but these errors were encountered: