diff --git a/core/misc/ajax.js b/core/misc/ajax.js index b63bc03..bea0af7 100644 --- a/core/misc/ajax.js +++ b/core/misc/ajax.js @@ -439,6 +439,11 @@ // Bind the ajaxSubmit function to the element event. $(ajax.element).on(element_settings.event, function (event) { + // Prevent the Ajax command from being triggered when a mouse button + // other than the left button is clicked. + if (event.type === 'mousedown' && event.which !== 1) { + return; + } if (!drupalSettings.ajaxTrustedUrl[ajax.url] && !Drupal.url.isLocal(ajax.url)) { throw new Error(Drupal.t('The callback URL is not local and not trusted: !url', {'!url': ajax.url})); }