|
@@ -20,12 +20,19 @@ class TabsFoundation<P = Record<string, any>, S = Record<string, any>> extends B
|
|
|
|
|
|
destroy = noop;
|
|
|
|
|
|
+ _notifyChange(activeKey: string): void {
|
|
|
+ const { activeKey: stateActiveKey } = this.getStates();
|
|
|
+ if (stateActiveKey !== activeKey) {
|
|
|
+ this._adapter.notifyChange(activeKey);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
handleTabClick(activeKey: string, event: any): void {
|
|
|
const isControledComponent = this._isInProps('activeKey');
|
|
|
if (isControledComponent) {
|
|
|
- this._adapter.notifyChange(activeKey);
|
|
|
+ this._notifyChange(activeKey);
|
|
|
} else {
|
|
|
- this._adapter.notifyChange(activeKey);
|
|
|
+ this._notifyChange(activeKey);
|
|
|
this.handleNewActiveKey(activeKey);
|
|
|
}
|
|
|
this._adapter.notifyTabClick(activeKey, event);
|