@@ -117,12 +117,15 @@ const _apiProps = {
117117} ;
118118Helper . setNoneEnumProps ( _apiProps , {
119119 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 ;
126129 } ,
127130 eventHandlerFactory : function ( { e, id } ) {
128131 const el = e . target , parentEl = el . parentElement , { closeClass, tabClass } = this . optionsManager . setting ;
@@ -133,7 +136,11 @@ Helper.setNoneEnumProps(_apiProps, {
133136 }
134137 else {
135138 // 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+ }
137144 }
138145 }
139146} ) ;
0 commit comments