Elias Ghali
Elias Ghali

Reputation: 863

onBlur is called from child elements

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

Upvotes: 8

Views: 6690

Answers (1)

brennvo
brennvo

Reputation: 99

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

Upvotes: 4

Related Questions