Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lakshmi2506 committed Dec 4, 2023
1 parent 8fd3fce commit d8d8f20
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions src/js/components/tasks/retrieveMetadata/changes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import Checkbox from '@salesforce/design-system-react/components/checkbox';
import Icon from '@salesforce/design-system-react/components/icon';
import Tooltip from '@salesforce/design-system-react/components/tooltip';
import classNames from 'classnames';
import React, { ChangeEvent, useEffect, useRef, useState } from 'react';
import React, {
ChangeEvent,
RefObject,
useEffect,
useRef,
useState,
} from 'react';
import { useTranslation } from 'react-i18next';

import {
Expand Down Expand Up @@ -207,14 +213,25 @@ const ChangesForm = ({
) => {
updateChecked(ignoredChanges, checked);
};
const checkboxRef = useRef(null);

interface CheckboxRefType {
input?: HTMLElement | null;
// Add other properties if needed
}
// eslint-disable-next-line import/no-named-as-default-member
const checkboxRef: RefObject<CheckboxRefType> = React.createRef();
// const checkboxRef = useRef(null);
useEffect(() => {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
if (checkboxRef.current && checkboxRef.current!.input) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
checkboxRef.current!.input.focus();
const currentRef = checkboxRef.current;

if (
currentRef &&
currentRef.input &&
typeof currentRef.input.focus === 'function'
) {
currentRef.input.focus();
}
}, [totalChanges]);
}, [checkboxRef, totalChanges]);

return (
<form
Expand Down

0 comments on commit d8d8f20

Please sign in to comment.