From b24f5bc01486fa08dd91f3f847894b6de5b9e864 Mon Sep 17 00:00:00 2001 From: swarnadipa-dev Date: Wed, 2 Aug 2023 17:41:01 +0530 Subject: [PATCH] WEBUI-1215: fix enable tab navigation through drawer --- elements/nuxeo-app.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/elements/nuxeo-app.js b/elements/nuxeo-app.js index ca6e034950..6e407b5bb9 100644 --- a/elements/nuxeo-app.js +++ b/elements/nuxeo-app.js @@ -339,6 +339,7 @@ Polymer({ on-iron-activate="_toggleDrawer" aria-label$="[[i18n('app.drawer')]]" aria-expanded="[[drawerOpened]]" + on-keyup="_toggleDrawer" > { + this._toggleDrawer(event, { detail: { selected: event.target.getAttribute('name') } }); + }); }, _resetTaskSelection() { @@ -987,11 +991,14 @@ Polymer({ this.navigateTo('search', target.searchName); }, - _toggleDrawer(e) { - if (e.detail.selected && this._selected === e.detail.selected && this.drawerOpened) { + _toggleDrawer(e, selectedObj) { + const selectedItem = e.type === 'keyup' ? selectedObj : e; + const selectedItemDetailSelected = + selectedItem.detail && selectedItem.detail.selected ? selectedItem.detail.selected : 0; + if (this._selected === selectedItemDetailSelected && this.drawerOpened) { this._closeDrawer(); } else { - this._selected = this.selectedTab = e.detail.selected; + this._selected = this.selectedTab = selectedItemDetailSelected; this._openDrawer(); } },