etr2460 commented on a change in pull request #10475:
URL:
https://github.com/apache/incubator-superset/pull/10475#discussion_r462552385
##########
File path: superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx
##########
@@ -260,6 +263,14 @@ class Tabs extends React.PureComponent {
onDeleteTab={this.handleDeleteTab}
/>
}
+ onExiting={() => {
+ // Exiting previous tab, animating start
+ this.props.setIsAnimating(true, tabId);
+ }}
+ onEntering={() => {
+ // Entering current tab, DOM is visible and has dimension
+ this.props.setIsAnimating(false, tabId);
+ }}
Review comment:
maybe they could be `onMount` and `onUnmount`? Or `afterMount` and
`beforeUnmount`?
##########
File path: superset-frontend/src/dashboard/actions/dashboardState.js
##########
@@ -321,6 +321,14 @@ export function setDirectPathToChild(path) {
return { type: SET_DIRECT_PATH, path };
}
+export const SET_IS_TAB_MOUNTED = 'SET_IS_TAB_MOUNTED';
+/**
+ * Set if tab switch animation is in progress
+ */
+export function setIsTabMounted(isAnimating) {
Review comment:
maybe rename this variable to `isTabMounted` to match the function name?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]