8

i have a container div that contains many inputs and checkboxes inside, i want to trigger an onBlur event only when the container div loses focus, instead the onBlur event is triggered everytime any element inside it loses focus

Elias Ghali
  • 823
  • 1
  • 13
  • 29
  • Please post the code relevant to your issue, and I'd be glad to assist. – Chris Jul 11 '17 at 08:23
  • 1
    Check this answer --> [https://stackoverflow.com/questions/12092261/prevent-firing-the-blur-event-if-any-one-of-its-children-receives-focus](https://stackoverflow.com/questions/12092261/prevent-firing-the-blur-event-if-any-one-of-its-children-receives-focus) – s.d.90 Nov 19 '17 at 13:29

1 Answers1

4

React documents this problem by utilizing the event loop with a setTimeout function with an empty second argument.

brennvo
  • 89
  • 1
  • 7