Skip to content

Commit 90f14e0

Browse files
authored
fix: emit change event on tablist only when active tab has changed (#34055)
1 parent bc19eff commit 90f14e0

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "fix: emit change event on tablist only when active tab changed",
4+
"packageName": "@fluentui/web-components",
5+
"email": "machi@microsoft.com",
6+
"dependentChangeType": "patch"
7+
}

packages/web-components/src/tablist/tablist.base.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ export class BaseTablist extends FASTElement {
9797
activePanel.hidden = false;
9898
}
9999
}
100+
101+
if (oldValue !== newValue) {
102+
this.change();
103+
}
100104
}
101105
}
102106

@@ -173,7 +177,6 @@ export class BaseTablist extends FASTElement {
173177
this.activetab = tab;
174178
this.activeid = tabId;
175179
}
176-
this.change();
177180
}
178181
});
179182
}
@@ -188,7 +191,6 @@ export class BaseTablist extends FASTElement {
188191
if (this.activeTabIndex !== this.prevActiveTabIndex) {
189192
this.activeid = this.tabIds[this.activeTabIndex] as string;
190193
this.focusTab();
191-
this.change();
192194
}
193195
}
194196

0 commit comments

Comments
 (0)