Skip to content

Commit

Permalink
fix: get container ref
Browse files Browse the repository at this point in the history
  • Loading branch information
denkristoffer committed Oct 20, 2020
1 parent 8944105 commit 9a1bc38
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ export const DropdownContainer = forwardRef<
document.body.appendChild(portalTarget.current);
document.addEventListener('mousedown', trackOutsideClick, true);

getRef?.(dropdown.current);

return () => {
document.body.removeChild(portalTarget.current);
document.removeEventListener('mousedown', trackOutsideClick, true);
Expand Down Expand Up @@ -94,6 +92,10 @@ export const DropdownContainer = forwardRef<
ref={(node) => {
setReference(node);
dropdown.current = node;

if (getRef) {
getRef(node);
}
}}
style={style}
>
Expand Down

0 comments on commit 9a1bc38

Please sign in to comment.