Skip to content

Commit

Permalink
Selection: ignore right mouse click
Browse files Browse the repository at this point in the history
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
  • Loading branch information
msssk committed Jun 19, 2020
1 parent 29b0314 commit 8d369a4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)) ||
Expand Down

0 comments on commit 8d369a4

Please sign in to comment.