Skip to content

Commit

Permalink
fix(Dropdown): add checking if ref exists on dropdown (#958)
Browse files Browse the repository at this point in the history
* fix: add checking if ref exists on dropdown

* Update src/Dropdown.tsx

Co-authored-by: Jason Quense <monastic.panic@gmail.com>

* linting

Co-authored-by: Jason Quense <monastic.panic@gmail.com>
  • Loading branch information
golota60 and jquense committed Jun 23, 2021
1 parent 849ab56 commit b0363c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ function Dropdown({
(e) => {
if (
(e.key === 'Tab' && !e.target) ||
!menuRef.current!.contains(e.target as HTMLElement)
!menuRef.current?.contains(e.target as HTMLElement)
) {
onToggle(false, event);
}
Expand Down

0 comments on commit b0363c0

Please sign in to comment.