Issue 1:
If a parent object of the Bootstrap Carousel is hidden using the jQuery .hide() method while the Carousel is in the middle of animating to a new slide, the Carousel will no longer animate when the same parent is unhidden using the jQuery .show() method.

This can be duplicated on the Carousel demo page found here: http://twitter.github.com/bootstrap/javascript.html#carousel

In a debug console on that page, one can hide the Carousel's parent by using the following javascript:

$("section#carousel").hide()

and then show it's parent again using this line:

$("section#carousel").show()

If the parent is hidden when the demo images are moving between slides, and then shown again later, there is no way to trigger the animations again until the page is reloaded.

At a first pass, it looks like this.sliding is never reset back to false unless the animations are able to finish correctly. Hiding the parent seems to cancel the animations without their events triggering a reset of the this.sliding variable.

When I tried adding a "reset" that would put this.sliding back to false, it still didn't work. I'm not sure what I'm missing.

I have been unable to find a suitable workaround so far.

Issue 2:
This is only a bug tested in IE 9 and 10. The bug is not produced in Firefox or Chrome. Also note that this bug in ONLY reproduced in modals. This method works for selecting text when not in a modal window.

I am programmatically selecting text from a div in a modal. The focus event in Bootstrap 2.3.1 on line 907 (shown below) conflicts with the selecting of text.

enforceFocus: function () {
var that = this
$(document).on('focusin.modal', function (e) {
if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
that.$element.focus()
}
})
}

Below is code to duplicate the issue only in IE.

HTML

<button href="#myModal" role="button" class="btn" data-toggle="modal">Show Modal</button>

<div id="myModal" class="modal hide fade" data-backdrop="false">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>Modal header</h3>
</div>
<div class="modal-body">
<button class="btn textSelector">Select All</button>
<div>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Username</th>
<th>Password</th>
<th>Email</th>
</tr>
</thead>
<tbody>
<tr>
<td>Tuna Child</td>
<td>tchild</td>
<td>t</td>
<td>tuna@tuna.com</td>
</tr>
<tr>
<td>Joshua Hazengoa</td>
<td>jhazengoa</td>
<td>jj32</td>
<td>josh@tunaeater.com</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" data-dismiss="modal">Close</button>
</div>
</div>

The JavaScript to simulate selecting the text:

$('.textSelector').click(function(){
var text = $(this).siblings().find("table").parent()[0];
var range;
if(document.body.createTextRange){ //ms
range = document.body.createTextRange();
range.moveToElementText(text);
range.select();
}else if(window.getSelection){ //all others
var selection = window.getSelection();
range = document.createRange();
range.selectNodeContents(text);
selection.removeAllRanges();
selection.addRange(range);
}
});

I have isolated the issue in the bootstrap source on line 907 (as mentioned above) and have added a bandage fix to my code above, at the top of the click event:

$(document).off("focusin.modal");