Skip to content

Commit

Permalink
Fix handleClickOutside
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaias Buscarino committed Apr 20, 2022
1 parent 1f1f35e commit 959a20e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -761,8 +761,7 @@ class PhoneInput extends React.Component {
handleClickOutside = (e) => {
const portal = this.portalRef.current;

if (portal && !portal.contains(e.target)) {
console.log('handleClickOutside')
if ((this.dropdownRef && !this.dropdownContainerRef.contains(e.target)) && (portal && !portal.contains(e.target))) {
this.state.showDropdown && this.setState({ showDropdown: false });
}
}
Expand Down

0 comments on commit 959a20e

Please sign in to comment.