Skip to content

Commit

Permalink
Callback
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriellsh committed Apr 26, 2021
1 parent 2cfe180 commit f443252
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/fuselage/src/components/Dropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ const Dropdown = ({ children, overlay }) => {
);

const onClick = useCallback(() => {
ref?.current?.focus() && show();
ref?.current?.classList.add('focus-visible');
show();
if (ref && ref.current) {
ref.current.focus();
ref.current.classList.add('focus-visible');
}
}, [show]);

return (
Expand Down

0 comments on commit f443252

Please sign in to comment.