Skip to content

Latest commit

 

History

History
21 lines (17 loc) · 362 Bytes

custom-blur-handlers.md

File metadata and controls

21 lines (17 loc) · 362 Bytes

Custom Blur Handlers

Easily check if you focusing on an element outside of a desired node tree.

onBlur = (e) => {
  if ( !e.currentTarget.contains( e.relatedTarget ) ) {
    console.log('blur event');
  }
}

render() {
  return (
    <div onBlur={this.onBlur}>
      ..
    </div>
  )
}

Found here.