@@ -15,7 +15,7 @@ import { NameGenerator } from "comps/utils";
15
15
import { ScrollBar , Section , sectionNames } from "lowcoder-design" ;
16
16
import { HintPlaceHolder } from "lowcoder-design" ;
17
17
import _ from "lodash" ;
18
- import React , { useContext , useMemo } from "react" ;
18
+ import React , { useContext , useMemo , useEffect } from "react" ;
19
19
import styled , { css } from "styled-components" ;
20
20
import { IContainer } from "../containerBase/iContainer" ;
21
21
import { SimpleContainerComp } from "../containerBase/simpleContainerComp" ;
@@ -266,6 +266,11 @@ const TabbedContainer = (props: TabbedContainerProps) => {
266
266
const selectedTab = visibleTabs . find ( ( tab ) => tab . key === props . selectedTabKey . value ) ;
267
267
const activeKey = selectedTab ?selectedTab . key :visibleTabs . length > 0 ?visibleTabs [ 0 ] . key :undefined ;
268
268
269
+ useEffect ( ( ) => {
270
+ if ( activeKey && activeKey !== props . selectedTabKey . value ) {
271
+ props . selectedTabKey . onChange ( activeKey ) ;
272
+ }
273
+ } , [ activeKey , props . selectedTabKey . value ] ) ;
269
274
270
275
const editorState = useContext ( EditorContext ) ;
271
276
const maxWidth = editorState . getAppSettings ( ) . maxWidth ;