W
W
wiincked2019-11-20 12:38:52
JavaScript
wiincked, 2019-11-20 12:38:52

How to remove the call of 2 handlers when clicking on a child element?

Good afternoon!
I have a handler when clicking on the parent block, which outputs a message to the console.
Inside the parent block there is a button, when clicking on it, another handler should occur, but all two handlers are called.
Can you please tell me how can I make it so that only one handler is called when the button is clicked.
Link to example https://codesandbox.io/s/priceless-moon-hb7h1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-11-20
@wiincked

google what event bubbling is and how to stop it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question