From a6ca0a8c2724a47be7fbdaade68e1933f6a8632a Mon Sep 17 00:00:00 2001 From: saket2403 Date: Fri, 20 Oct 2023 18:17:49 +0530 Subject: [PATCH 1/2] Keyboard nav fix --- packages/terra-tabs/src/common-tabs/_Tab.jsx | 4 ++++ packages/terra-tabs/tests/wdio/tabs-spec.js | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/packages/terra-tabs/src/common-tabs/_Tab.jsx b/packages/terra-tabs/src/common-tabs/_Tab.jsx index 3cce6228632..3bbec5bedff 100644 --- a/packages/terra-tabs/src/common-tabs/_Tab.jsx +++ b/packages/terra-tabs/src/common-tabs/_Tab.jsx @@ -221,6 +221,10 @@ const Tab = ({ onChange(event, itemKey); } } + // Fix for keyboard navigation after mouse click which was failing due to draggable props. + if (isDraggable) { + event.currentTarget.focus(); + } } attributes.tabIndex = isSelected ? 0 : -1; attributes.onClick = onClick; diff --git a/packages/terra-tabs/tests/wdio/tabs-spec.js b/packages/terra-tabs/tests/wdio/tabs-spec.js index d77b2d21ae7..e2a904f0cfb 100644 --- a/packages/terra-tabs/tests/wdio/tabs-spec.js +++ b/packages/terra-tabs/tests/wdio/tabs-spec.js @@ -164,6 +164,11 @@ Terra.describeViewports('Tabs - Drag and Drop', ['medium'], () => { browser.keys(['Tab', 'Tab', 'Space', 'ArrowRight', 'Space']); Terra.validates.element('After Drag and Drop', { selector: '#root' }); }); + it('should navigate with keyboard after mouse click', () => { + $('#controlledTabs-Radiology').click(); + browser.keys(['ArrowRight']); + expect($('#controlledTabs-Cardiology')).toBeFocused(); + }); }); Terra.describeViewports('Tabs - Add and Close', ['medium'], () => { From 95c249db5c3b7aefdca00ca5299af9ca65f79831 Mon Sep 17 00:00:00 2001 From: saket2403 Date: Fri, 20 Oct 2023 18:18:54 +0530 Subject: [PATCH 2/2] Changelog --- packages/terra-tabs/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/terra-tabs/CHANGELOG.md b/packages/terra-tabs/CHANGELOG.md index eddf3cb04fc..f60867931ae 100644 --- a/packages/terra-tabs/CHANGELOG.md +++ b/packages/terra-tabs/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +* Fixed + * Fixed keyboard navigation after mouse click for draggable tabs. + ## Unreleased ## 7.11.0 - (October 20, 2023)