Modal hides instantly after showing


I have a feeling this is a very silly question but it would save me some time if someone pointed me in the right direction. I´m using a bootstrap modal using:

Html::button('<span class="glyphicon glyphicon-trash" aria-hidden="true"></span> Delete', [

		'class' => 'btn btn-danger btn-xs', 

		'data' => [

		'toggle' => 'modal',

		'target' => '#userModal',




	'id' => 'deleteModal',

	'header' => '<h2>Delete record</h2>',

	'footer' => '<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

        		  <button type="button" class="btn btn-primary">Save changes</button>',


When I click the button the modal renders but hides instantly after the show animation is done. If I use ordinary HTML for the modal instead of yii\bootstrap\Modal it works as expected. What am I missing? Why does the modal generated by Yii behave differently? I have compared the generated HTML with the working HTML I copy/pasted from and there are very few differences.

Any clues?