Skip to content

Commit

Permalink
Reassigned isNotDirectChild after each loop
Browse files Browse the repository at this point in the history
  • Loading branch information
rufataliy committed Feb 3, 2021
1 parent 459ef38 commit e1e50a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/components/common/ToggleGroup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ export default function ToggleGroup({
if (isContainerClicked) return;

let element = e.target;

const isNotDirectChildOfContainer = !element.parentElement.classList.contains(classes.root);
let isNotDirectChildOfContainer = !element.parentElement.classList.contains(classes.root);
while (isNotDirectChildOfContainer) {
element = element.parentElement;
isNotDirectChildOfContainer = !element.parentElement.classList.contains(classes.root);
}

setSelectedValue(element.value);
Expand Down

0 comments on commit e1e50a2

Please sign in to comment.