Wk-notes-11-07-vitual-box-n-onblur-for-div
Virtual box IE/Edge testing
To achieve similar onBlur effect for a div
// onEnter(){
// onOpen(){
onMount(){
document.addEventListener('click', this.handleOutsideInteraction);
document.addEventListener('focusin', this.handleOutsideInteraction);
}
// onExit(){
// onClose(){
onUnMount(){
document.removeEventListener('click', this.handleOutsideInteraction);
document.removeEventListener('focusin', this.handleOutsideInteraction);
}
handleOutsideInteraction(event){
// Check if the click/focus event is happening inside of the wrapper element
if(this.wrapperEL && !this.wrapperEL.contains(event.target)){
// if event is not in wrapper, do onBlur
this.props.handleOnBlur();
}
}Last updated