You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/04/05 13:43:58 UTC

[GitHub] [airflow] bbovenzi commented on a diff in pull request #22742: Improve Grid view selection rerenders

bbovenzi commented on code in PR #22742:
URL: https://github.com/apache/airflow/pull/22742#discussion_r842802555


##########
airflow/www/static/js/tree/StatusBox.jsx:
##########
@@ -46,20 +45,21 @@ export const SimpleStatus = ({ state, ...rest }) => (
 );
 
 const StatusBox = ({
-  group, instance,
+  group, instance, onSelect,
 }) => {
   const containerRef = useContainerRef();
-  const { selected, onSelect } = useSelection();
   const { runId, taskId } = instance;
   const { colors } = useTheme();
   const hoverBlue = `${colors.blue[100]}50`;
 
   // Fetch the corresponding column element and set its background color when hovering
   const onMouseEnter = () => {
-    if (selected.runId !== runId) {
-      [...containerRef.current.getElementsByClassName(`js-${runId}`)]
-        .forEach((e) => { e.style.backgroundColor = hoverBlue; });
-    }
+    [...containerRef.current.getElementsByClassName(`js-${runId}`)]
+      .forEach((e) => {
+        const bg = window.getComputedStyle(e).backgroundColor;
+        // Don't apply hover if it is already selected
+        if (bg !== 'rgb(190, 227, 248)') e.style.backgroundColor = hoverBlue;

Review Comment:
   Yeah, I wasnt too happy with color either. Let me do the data attribute.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org