Browse Source

remove mouseenter in table

Gitea 3 years ago
parent
commit
5b39391f85
2 changed files with 0 additions and 19 deletions
  1. 0 18
      client/src/components/grid/Table.tsx
  2. 0 1
      client/src/components/grid/Types.ts

+ 0 - 18
client/src/components/grid/Table.tsx

@@ -133,7 +133,6 @@ const EnhancedTable: FC<TableType> = props => {
     orderBy,
   } = props;
   const classes = useStyles({ tableCellMaxWidth });
-  const [tableMouseStatus, setTableMouseStatus] = React.useState<boolean[]>([]);
   const [loadingRowCount, setLoadingRowCount] = useState<number>(0);
 
   const containerRef = useRef(null);
@@ -198,20 +197,6 @@ const EnhancedTable: FC<TableType> = props => {
                   const isItemSelected = isSelected(row);
                   const labelId = `enhanced-table-checkbox-${index}`;
 
-                  const handleMouseEnter = () => {
-                    setTableMouseStatus(v => {
-                      const copy = [...v];
-                      copy[index] = true;
-                      return copy;
-                    });
-                  };
-                  const handleMouseLeave = () =>
-                    setTableMouseStatus(v => {
-                      const copy = [...v];
-                      copy[index] = false;
-                      return copy;
-                    });
-
                   return (
                     <TableRow
                       hover={showHoverStyle}
@@ -224,8 +209,6 @@ const EnhancedTable: FC<TableType> = props => {
                       classes={{
                         hover: classes.rowHover,
                       }}
-                      onMouseEnter={handleMouseEnter}
-                      onMouseLeave={handleMouseLeave}
                     >
                       {openCheckBox && (
                         <TableCell
@@ -257,7 +240,6 @@ const EnhancedTable: FC<TableType> = props => {
                             style={cellStyle}
                           >
                             <ActionBar
-                              showLabel={tableMouseStatus[index]}
                               configs={actionBarConfigs}
                               isHoverType={colDef.isHoverAction}
                               row={row}

+ 0 - 1
client/src/components/grid/Types.ts

@@ -144,7 +144,6 @@ export type MilvusGridType = ToolBarType & {
 export type ActionBarType = {
   configs: ActionBarConfig[];
   row: any;
-  showLabel?: boolean;
   isHoverType?: boolean;
 };