The best answer I could find is in a discussion I found here about it from the twitter bootstap github. Here's a quote from the conversation:
This seems to be a breaking change in 2.1 as previously the keyup
event was bound to the document but now is bound to the actual modal
element. Hence, the the tabindex attribute is now required.
So basically when the JQuery library was updated from 2.0.X to 2.1.X the keyup
event which was bound to the document
element was changed so its now bound to the modal
element which caused the escape keyup to not be recognized on some browsers which is why the tabIndex='-1'
is now required.
This is how the tabindex helps
A tabindex="-1"
value removes the element from the default navigation
flow (i.e., a user cannot tab to it), but it allows it to receive
programmatic focus, meaning focus can be set to it from a link or with
scripting.** This can be very useful for elements that should not be
tabbed to, but that may need to have focus set to them.
This quote was taken from this question here which has a great answer if you want to read up more on what the tabindex does. Hope that helps.