From 8d369a4de6946d9ac6de4110c0d36d715fadfedb Mon Sep 17 00:00:00 2001 From: Mangala SSS Khalsa Date: Thu, 18 Jun 2020 22:27:09 -0700 Subject: [PATCH] Selection: ignore right mouse click When clicking a row or cell with the secondary mouse button it is not expected that a selection event should occur. This change updates Selection.js to ignore right mouse clicks. Fixes #1354 --- Selection.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Selection.js b/Selection.js index a3ceefbc1..e019cf263 100644 --- a/Selection.js +++ b/Selection.js @@ -3,13 +3,13 @@ define([ 'dojo/on', 'dojo/has', 'dojo/aspect', - './List', + 'dojo/mouse', 'dojo/has!touch?./util/touch', 'put-selector/put', 'dojo/query', 'dojo/_base/sniff', 'dojo/dom' // for has('css-user-select') in 1.8.2+ -], function (declare, on, has, aspect, List, touchUtil, put) { +], function (declare, on, has, aspect, mouse, touchUtil, put) { has.add('dom-comparedocumentposition', function (global, doc, element) { return !!element.compareDocumentPosition; @@ -214,6 +214,10 @@ define([ }, _handleSelect: function (event, target) { + if (mouse.isRight(event)) { + return; + } + // Don't run if selection mode doesn't have a handler (incl. "none"), target can't be selected, // or if coming from a dgrid-cellfocusin from a mousedown if (!this[this._selectionHandlerName] || !this.allowSelect(this.row(target)) ||