@@ -117,12 +117,15 @@ const _apiProps = {
117
117
} ;
118
118
Helper . setNoneEnumProps ( _apiProps , {
119
119
getInitialState : function ( ) {
120
- const { selectedTabID, tabs, defaultPanelComponent } = this . optionsManager . options , openTabIDs = [ ] ;
121
- tabs . map ( tab => {
122
- this . _addTab ( tab , { defaultPanelComponent } ) ;
123
- openTabIDs . push ( tab . id ) ;
124
- } ) ;
125
- return { selectedTabID, openTabIDs } ;
120
+ if ( ! this . _initialState ) {
121
+ const { selectedTabID, tabs, defaultPanelComponent } = this . optionsManager . options , openTabIDs = [ ] ;
122
+ tabs . map ( tab => {
123
+ this . _addTab ( tab , { defaultPanelComponent } ) ;
124
+ openTabIDs . push ( tab . id ) ;
125
+ } ) ;
126
+ this . _initialState = { selectedTabID, openTabIDs } ;
127
+ }
128
+ return this . _initialState ;
126
129
} ,
127
130
eventHandlerFactory : function ( { e, id } ) {
128
131
const el = e . target , parentEl = el . parentElement , { closeClass, tabClass } = this . optionsManager . setting ;
@@ -133,7 +136,11 @@ Helper.setNoneEnumProps(_apiProps, {
133
136
}
134
137
else {
135
138
// if just on of the beforeSelect subscribers return false then it will prevent tab from select
136
- this . trigger ( 'beforeSelect' , this . userProxy , e , id ) . includes ( false ) || this . select ( id ) ;
139
+ if ( ! this . trigger ( 'beforeSelect' , this . userProxy , e , id ) . includes ( false ) ) {
140
+ this . select ( id ) . then ( result => {
141
+ } ) . catch ( er => {
142
+ } ) ;
143
+ }
137
144
}
138
145
}
139
146
} ) ;
0 commit comments