Răsfoiți Sursa

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

NEEDLEMAN3\tatsu 4 ani în urmă
părinte
comite
324fc3d624

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

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