fix: default value

This commit is contained in:
shuai
2024-01-17 10:01:37 +08:00
parent ce82ef50a9
commit 6bf3d3cf72
@@ -49,7 +49,7 @@ const Index: FC<Props> = ({
keyPrefix: 'invite_to_answer',
});
const [peopleList, setPeopleList] = useState<UserInfoCheck[]>([]);
const [currentIndex, setCurrentIndex] = useState(0);
const [currentIndex, setCurrentIndex] = useState(-1);
const [searchValue, setSearchValue] = useState('');
const filterAndSetPeople = (source) => {
const filteredPeople: Type.UserInfoBase[] = [];
@@ -85,7 +85,7 @@ const Index: FC<Props> = ({
};
const resetSearch = () => {
setCurrentIndex(0);
setCurrentIndex(-1);
setSearchValue('');
setPeopleList([]);
};
@@ -164,10 +164,10 @@ const Index: FC<Props> = ({
<Form.Check
type="checkbox"
id={p.username}
tabIndex={-1}
className="position-relative">
<Form.Check.Input
type="checkbox"
tabIndex={-1}
checked={Boolean(
selectedPeople?.find((v) => v.id === p.id),
)}