@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.
@@ -82,6 +82,7 @@ declare class TabList extends TabList_base {
82
82
  * @internal
83
83
  */
84
84
  private showBackwardArrowButton;
85
+ private readonly boundHandleFocus;
85
86
  /**
86
87
  * @internal
87
88
  */
@@ -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.handleFocus.bind(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.handleFocus);
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",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@momentum-design/components",
3
3
  "packageManager": "yarn@3.2.4",
4
- "version": "0.139.2",
4
+ "version": "0.139.3",
5
5
  "engines": {
6
6
  "node": ">=24.0.0",
7
7
  "npm": ">=8.0.0"