-
Notifications
You must be signed in to change notification settings - Fork 859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dia.Paper: blank:contextmenu
event is fired differently on MacOS and Windows
#1590
Comments
What does it do on Windows? |
on mac : |
I am sorry, I don't understand. What is exactly |
it's my fault, my poor english. |
Right, we've tried both and can't see anything wrong (in Chrome on Win and macOS). Could share a video perhaps? |
Sorry, i don't konw how to express what i mean |
|
I tested the bpmn demo in Chrome on MacOS and Windows and the behavior of drag & drop is different. |
Ok, thanks, everyone. We'll look into it. |
Windows - We have to deal with this on our side and trigger an event ourselves similarly to - mapbox/mapbox-gl-js#3803 |
blank:contextmenu
event is fired differently on MacOS and Windows
A workaround for the time being: joint.dia.Paper.prototype.pointerdown = function(evt) {
evt = joint.util.normalizeEvent(evt);
var view = this.findView(evt.target);
var isContextmenu = false;
if (this.guard(evt, view)) {
if (evt.type !== 'mousedown' || evt.button !== 2) return;
isContextmenu = true;
}
var localPoint = this.snapToGrid(evt.clientX, evt.clientY);
if (view) {
evt.preventDefault();
view.pointerdown(evt, localPoint.x, localPoint.y);
} else {
if (this.options.preventDefaultBlankAction) evt.preventDefault();
this.trigger('blank:pointerdown', evt, localPoint.x, localPoint.y);
}
if (isContextmenu) {
setTimeout(() => { this.delegateDragEvents(view, evt.data); }, 0);
} else {
this.delegateDragEvents(view, evt.data);
}
};
paper.delegateEvents();
paper.on({
'blank:pointerdown': function(evt, x, y) {
if (evt.button === 2) {
evt.preventDefault();
paperScroller.startPanning(evt, x, y);
} else {
closeTools();
selection.startSelecting(evt, x, y);
}
}
}); |
This issue is stale because it has been open 60 days with no activity. Please remove stale label or comment or this will be closed in 14 days. |
I noticed that right click dragging paper has different performance in different OS.
such as mac and windows.
https://resources.jointjs.com/demos/bpmn
How can i keep it in the same performance, Thanks in advance.
The text was updated successfully, but these errors were encountered: