diff --git a/src/components/registration/topicSelection/TopicSelection.tsx b/src/components/registration/topicSelection/TopicSelection.tsx index 6fd3409df..042621ed2 100644 --- a/src/components/registration/topicSelection/TopicSelection.tsx +++ b/src/components/registration/topicSelection/TopicSelection.tsx @@ -45,11 +45,16 @@ export const TopicSelection: VFC<{ const [topics, setTopics] = useState([]); const [isLoading, setIsLoading] = useState(false); const [listView, setListView] = useState(false); + const [topicGroupId, setTopicGroupId] = useState(0); const getTopic = (mainTopicId: number) => { return topics?.filter((topic) => topic?.id === mainTopicId)?.[0]; }; + const getTopicInteraction = (topicGroupId: number) => { + setTopicGroupId(topicGroupId); + }; + useEffect(() => { if ( REGISTRATION_DATA_VALIDATION.mainTopicId.validation( @@ -347,10 +352,15 @@ export const TopicSelection: VFC<{ topic?.id } ); + getTopicInteraction( + topicGroup.id + ); }} checked={ value === - topic?.id + topic?.id && + topicGroup.id === + topicGroupId } /> } @@ -411,7 +421,7 @@ export const TopicSelection: VFC<{ ))} - ))} + ))} )}