Explorar o código

refs #83365: search select checkbox indeterminate
- WIP: set indeterminate attribute

NEEDLEMAN3\tatsu %!s(int64=4) %!d(string=hai) anos
pai
achega
324fc3d624

+ 2 - 8
packages/app/src/components/SearchPage/DeleteSelectedPageGroup.tsx

@@ -4,12 +4,6 @@ import React, {
 import { useTranslation } from 'react-i18next';
 import { useTranslation } from 'react-i18next';
 import { CheckboxType } from '../../interfaces/search';
 import { CheckboxType } from '../../interfaces/search';
 
 
-class IndeterminateInputRef implements React.MutableRefObject<null> {
-
-  indeterminate?: boolean;
-
-}
-
 type Props = {
 type Props = {
   isSelectAllCheckboxDisabled: boolean,
   isSelectAllCheckboxDisabled: boolean,
   selectAllCheckboxType: CheckboxType,
   selectAllCheckboxType: CheckboxType,
@@ -34,9 +28,9 @@ const DeleteSelectedPageGroup:FC<Props> = (props:Props) => {
     if (onClickDeleteAllButton != null) { onClickDeleteAllButton() }
     if (onClickDeleteAllButton != null) { onClickDeleteAllButton() }
   };
   };
 
 
-  const elm:IndeterminateInputRef = useRef(null);
+  const elm = useRef({ indeterminate: false });
   useEffect(() => {
   useEffect(() => {
-    if (elm.current != null) {
+    if (elm.current != null && elm.current.indeterminate != null) {
       // eslint-disable-next-line
       // eslint-disable-next-line
       elm.current.indeterminate = selectAllCheckboxType === CheckboxType.INDETERMINATE;
       elm.current.indeterminate = selectAllCheckboxType === CheckboxType.INDETERMINATE;
     }
     }