@momentum-design/components 0.139.2 → 0.139.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -126,6 +126,9 @@ class TabList extends ListNavigationMixin(CaptureDestroyEventForChildElement(Key
|
|
|
126
126
|
* @internal
|
|
127
127
|
*/
|
|
128
128
|
this.showBackwardArrowButton = false;
|
|
129
|
+
this.boundHandleFocus = (event) => {
|
|
130
|
+
void this.handleFocus(event);
|
|
131
|
+
};
|
|
129
132
|
// This must be initialized after the destroyed event listener
|
|
130
133
|
// to keep the element in the itemStore in order to move the focus correctly
|
|
131
134
|
this.itemsStore = new ElementStore(this, {
|
|
@@ -168,12 +171,12 @@ class TabList extends ListNavigationMixin(CaptureDestroyEventForChildElement(Key
|
|
|
168
171
|
if (!this.activeTabId) {
|
|
169
172
|
this.activeTabId = (_a = getFirstTab(this.navItems)) === null || _a === void 0 ? void 0 : _a.tabId;
|
|
170
173
|
}
|
|
171
|
-
(_b = this.tabsContainer) === null || _b === void 0 ? void 0 : _b.addEventListener('focusin', this.
|
|
174
|
+
(_b = this.tabsContainer) === null || _b === void 0 ? void 0 : _b.addEventListener('focusin', this.boundHandleFocus);
|
|
172
175
|
}
|
|
173
176
|
disconnectedCallback() {
|
|
174
177
|
var _a;
|
|
175
178
|
super.disconnectedCallback();
|
|
176
|
-
(_a = this.tabsContainer) === null || _a === void 0 ? void 0 : _a.removeEventListener('focusin', this.
|
|
179
|
+
(_a = this.tabsContainer) === null || _a === void 0 ? void 0 : _a.removeEventListener('focusin', this.boundHandleFocus);
|
|
177
180
|
}
|
|
178
181
|
/**
|
|
179
182
|
* Override focus to delegate to the active tab.
|
|
@@ -205,6 +208,11 @@ class TabList extends ListNavigationMixin(CaptureDestroyEventForChildElement(Key
|
|
|
205
208
|
if (event.relatedTarget instanceof Tab || !(event.target instanceof Tab)) {
|
|
206
209
|
return;
|
|
207
210
|
}
|
|
211
|
+
// After scrolling with arrow buttons, focus moves from the button to the clicked tab.
|
|
212
|
+
// Do not redirect that focus back to the currently active tab.
|
|
213
|
+
if (event.relatedTarget instanceof Button) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
208
216
|
const activeTab = getActiveTab(this.navItems || []);
|
|
209
217
|
if (!(activeTab instanceof Tab)) {
|
|
210
218
|
return;
|
|
@@ -48481,6 +48481,12 @@
|
|
|
48481
48481
|
"module": "utils/mixins/TabListComponentMixin.js"
|
|
48482
48482
|
}
|
|
48483
48483
|
},
|
|
48484
|
+
{
|
|
48485
|
+
"kind": "field",
|
|
48486
|
+
"name": "boundHandleFocus",
|
|
48487
|
+
"privacy": "private",
|
|
48488
|
+
"readonly": true
|
|
48489
|
+
},
|
|
48484
48490
|
{
|
|
48485
48491
|
"kind": "field",
|
|
48486
48492
|
"name": "dataAriaLabel",
|