rusackas commented on code in PR #37777:
URL: https://github.com/apache/superset/pull/37777#discussion_r3488910481
##########
superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx:
##########
@@ -189,13 +189,17 @@ export const DataTablesPane = ({
ownState,
isRequest: isRequest.results,
setForceQuery,
- isVisible: ResultTypes.Results === activeTabKey,
canDownload,
- }).map((pane, idx) => ({
- key: idx === 0 ? ResultTypes.Results : `${ResultTypes.Results} ${idx + 1}`,
- label: idx === 0 ? t('Results') : t('Results %s', idx + 1),
- children: pane,
- }));
+ }).map((pane, idx) => {
+ const tabKey =
+ idx === 0 ? ResultTypes.Results : `${ResultTypes.Results} ${idx + 1}`;
+
+ return {
+ key: tabKey,
+ label: idx === 0 ? t('Results') : t('Results %s', idx + 1),
+ children: activeTabKey === tabKey ? pane : null,
Review Comment:
Good catch. If a mixed chart drops back to fewer result panes while "Results
2" is selected, the active key goes stale and the panel renders blank until you
reselect a valid tab (kind of a pre-existing edge case, but worth hardening
here). I pushed an effect that resets the active key to the first results tab
when the selected one no longer exists. Thanks!
--
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]