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


##########
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:
   I wonder if some sort of data attribute could be used to check this state? 
This seems a little fragile to be checking the color of the background.



-- 
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]

Reply via email to