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 May 12, 2020
1 parent 0da7bb9 commit 02b6750
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Selection.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
define([
'dojo/_base/declare',
'dojo/aspect',
'dojo/dom-class',
'dojo/mouse',
'dojo/on',
'dojo/has',
'dojo/aspect',
'./List',
'dojo/sniff',
'dojo/has!touch?./util/touch',
'dojo/query',
'dojo/_base/sniff',
'dojo/query', // for on.selector
'dojo/dom' // for has('css-user-select') in 1.8.2+
], function (declare, domClass, on, has, aspect, List, touchUtil) {
], function (declare, aspect, domClass, mouse, on, has, touchUtil) {

has.add('dom-comparedocumentposition', function (global, doc, element) {
return !!element.compareDocumentPosition;
Expand Down Expand Up @@ -214,6 +213,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 02b6750

Please sign in to comment.