You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/07/30 07:33:11 UTC

[GitHub] [incubator-superset] etr2460 commented on a change in pull request #10475: fix(dashboard): add animation state to fix tab switch re-renders

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org