From 303b7f670e83aba71fcd0ccbd5c35e3c7fdd741c Mon Sep 17 00:00:00 2001 From: swarnadipa-dev Date: Tue, 26 Sep 2023 17:07:08 +0530 Subject: [PATCH] WEBUI-1262 : BACKPORT: Make selection action in a nuxeo-data-grid card focusable --- elements/nuxeo-data-grid/nuxeo-document-grid-thumbnail.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/elements/nuxeo-data-grid/nuxeo-document-grid-thumbnail.js b/elements/nuxeo-data-grid/nuxeo-document-grid-thumbnail.js index 382cec3a7e..f7a55a7055 100644 --- a/elements/nuxeo-data-grid/nuxeo-document-grid-thumbnail.js +++ b/elements/nuxeo-data-grid/nuxeo-document-grid-thumbnail.js @@ -229,6 +229,7 @@ Polymer({ icon="icons:check" title="[[_computeTitle(doc)]]" on-tap="_onCheckBoxTap" + on-keydown="_onCheckBoxTap" role="checkbox" aria-checked="[[selected]]" > @@ -288,12 +289,15 @@ Polymer({ }, _onCheckBoxTap(e) { - this._toogleSelect(e); + // WEBUI-1262 : prevents checkbox selection during tab navigation + if (e.type === 'tap' || (e.key !== 'Tab' && e.key !== 'Shift')) { + this._toogleSelect(e); + } }, _toogleSelect(e) { this.selected = !this.selected; - this.fire('selected', { index: this.index, shiftKey: e.detail.sourceEvent.shiftKey }); + this.fire('selected', { index: this.index, shiftKey: e.type === 'tap' ? e.detail.sourceEvent.shiftKey : false }); }, _selectedItemsChanged() {