You don't need to override click behavior in this case.
The problem is, you are adding the child container to the
main container and both define click event. By default, event
propagates so when you click the child container, click event of
parent container also fires and it reverts back the currentState.
To fix this, you need to tell the child container to not
propagate the event by setting event.stopPropagation() to false. So
your code would look like: