From: hillai Date: Fri, 14 Nov 2014 15:09:50 +0000 (+0200) Subject: Add modal autofocus example X-Git-Tag: v3.3.2~61^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ada807ce6b99b95ce159a6b236309ab0ac425b3;p=thirdparty%2Fbootstrap.git Add modal autofocus example --- diff --git a/docs/_includes/js/modal.html b/docs/_includes/js/modal.html index 993b72103d..e2ed1918e1 100644 --- a/docs/_includes/js/modal.html +++ b/docs/_includes/js/modal.html @@ -15,7 +15,12 @@

There are some caveats regarding using modals on mobile devices. See our browser support docs for details.

-

Due to how HTML5 defines its semantics, the autofocus HTML attribute has no effect in Bootstrap modals.

+

Due to how HTML5 defines its semantics, the autofocus HTML attribute has no effect in Bootstrap modals. To achieve the same effect, use some custom JavaScript:

+ {% highlight js %} + $('#myModal').on('shown.bs.modal', function () { + $('#myInput').focus() + }) + {% endhighlight %}

Examples