When the escape key is released, I close the deepest child in a tree-like structure, and then tell it’s parent (which is now the new ‘deepest child’) to close when the escape key is released … but I do that while such an event is triggered, that causes the whole chain to close.
Any tips on how to overcome this problem?
Try add
event.stopImmediatePropagation()at the end of the listener.