Skip to content

Commit

Permalink
Headstorm#187 small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
harrisonnoble committed Aug 17, 2021
1 parent 58533fb commit 0eaf6ac
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/components/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ const Dropdown = ({

useEffect(() => {
if (isOpen) {
// setTimeout ensures this code renders after the initial render
const timer = window.setTimeout(() => {
const optionsContainer = optionsContainerInternalRef.current;
const hiddenContainer = hiddenOptionsContainerInternalRef.current;
Expand All @@ -474,12 +475,8 @@ const Dropdown = ({
// height is returned in pixels
hiddenContainer.style.height = `${optionsContainerHeight}px`;
}
}

if (optionsContainer) {
intersectObserver.observe(optionsContainer);
}
if (hiddenContainer) {
intersectObserver.observe(hiddenContainer);
}
}, 0);
Expand Down

0 comments on commit 0eaf6ac

Please sign in to comment.