A Better Twitter Bootstrap Modal
41–50 of 73 posts
Re: A Better Twitter Bootstrap Modal
#42Earlier quoted context omitted.
Is it really worth installing an entirely new library just to achieve something a simple line of CSS could do? .modal-background { background:white; } For me, Twitter Bootstrap's components have been the right tradeoff between flexibility and functionality. It doesn't have too many bells and whistles which makes it way easier to integrate into my own code. Maybe I just haven't run in to the use cases for Bootstrap's…
This is a drop-in replacement so that once you hit those use cases, you won't have the pain others have already felt before you. =)
Re: A Better Twitter Bootstrap Modal
#43Re: A Better Twitter Bootstrap Modal
#44Earlier quoted context omitted.
This is a drop-in replacement so that once you hit those use cases, you won't have the pain others have already felt before you. =)
I don't think it's safe to assume that a niche feature upgrade to a JS/CSS framework is inherently bug-free across browsers.
Re: A Better Twitter Bootstrap Modal
#45Re: A Better Twitter Bootstrap Modal
#46Re: A Better Twitter Bootstrap Modal
#47Re: A Better Twitter Bootstrap Modal
#48It suffers from the same bug as the stock bootstrap modal; focus is not contained in the popup window. Press tab a few times and soon your keyboard focus is on elements on the page behind the modal.
Re: A Better Twitter Bootstrap Modal
#49Re: A Better Twitter Bootstrap Modal
#50Earlier quoted context omitted.
Is there even a way to avoid that?
Not without heavy js code
I didn't understand that decision back then and I don't understand it today. The patch weighs in at about 100 lines which doesn't seem heavy to me. Especially when you consider that without the patch the bootstrap-"modal" is not a modal...
Anyway, here's the fixed bootstrap-modal.js for the version that was current back then:
https://gist.github.com/0d04646ab6cf4df50610
Line 23-82 is the important bit, that snippet is lifted nearly 1:1 from jquery.ui.dialog which fixed this issue ages ago. Beyond that there's only a couple lines of glue code.
Feel free to port this forward to the current version (or better-modal). Personally I've stopped using the javascript parts of bootstrap because I don't want to maintain forks for basic bugs like that.