Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap 2.2.1 modal bug - blue border around calling href?

I'm new here (and also with bootstrap and JavaScript) and hopefully im not asking a question already asked before. I did google plenty and search on here and could not find anyone mentioning this specific problem.

I found a bug I think with Bootstrap 2.2.1 .. when you close a modal, the href link which called it now has a blue border around it. This happens with buttons, nav items, anything. This can be seen on the Bootstrap live demo itself - click the blue button "Launch demo modal" under the section "Modals bootstrap-modal.js". You can see a light blue border around the button after closing the modal.

http://twitter.github.com/bootstrap/javascript.html#modals

This issue drove me mad, I messed with the CSS for ages, then tried different browsers, until I downgraded and the issue above is not present on bootstrap 2.0.4.

Does anyone know if this is a known issue with 2.2.1 or has it been present since a particular version?, or what the problem is here?

like image 278
deem720 Avatar asked Nov 30 '12 11:11

deem720


1 Answers

It's pretty simple fix once you locate what the CSS property is. I think it came from some issue with the modal's focus and they decided to modify the generated html. You need to define the following CSS. It comes from the following link.

.modal-open .modal,.btn:focus{
    outline:none!important
}

Hope it helps! I made a jsfiddle of the result (including bootstrap's css + js) so you watch a live demo of it, here. Note that if you're using something that isn't a button the outline may come back, since we're only applying it there. Since you're referring to a href, it's likely that you're calling the modal from a link, and therefore should also trigger a:focus

like image 113
Juan Cortés Avatar answered Sep 24 '22 07:09

Juan Cortés