msyavuz commented on code in PR #44345:
URL: https://github.com/apache/superset/pull/44345#discussion_r4063661080
##########
superset-frontend/src/dashboard/components/gridComponents/Tabs/Tabs.tsx:
##########
@@ -166,6 +166,25 @@ const Tabs = (props: TabsProps): ReactElement => {
const prevTabIds = usePrevious(props.component.children);
useEffect(() => {
+ // `activeKey` is seeded from state once, so a container that mounted
+ // without children keeps an unresolved key even after it receives its
+ // first one. Resolve it here so the new tab is selected and registered
+ // rather than being skipped by the guard below.
+ const tabId = props.component.children[selectedTabIndex];
+ if (!activeKey && tabId) {
Review Comment:
This only covers a key that was never set; deleting the last tab in edit
mode leaves an empty TABS with `activeKey` still pointing at the deleted tab,
so a tab added afterwards is never selected or registered. Would
`!props.component.children.includes(activeKey)` cover both cases?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]