Good point. event.stopPropagation() inside the if statement would be better. even that other key codes won't have any effect on the collapsible item it's better