fixed closing on click on button children (e.g. caret)

The problem is that you can't add child elements to dropdown button. Because dropdown closes immediately after opening if you click on child element (e.g. on caret).