Created
August 21, 2017 13:47
-
-
Save imgsrc/8ffaeb2bcbf4a86bdc3d7fb6bfd9c410 to your computer and use it in GitHub Desktop.
Функция проверка клика во вне компонента для закрытия
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
checkTargetClick( event ) { | |
if ( this.state.mode === 'click' && | |
event.target !== this.tooltip && | |
!this.tooltip.contains( event.target ) ) { | |
this.setState({ show: false }); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment