aboutsummaryrefslogtreecommitdiff
path: root/docs/_includes
diff options
context:
space:
mode:
Diffstat (limited to 'docs/_includes')
-rw-r--r--docs/_includes/js/modal.html7
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/_includes/js/modal.html b/docs/_includes/js/modal.html
index 993b72103..e2ed1918e 100644
--- a/docs/_includes/js/modal.html
+++ b/docs/_includes/js/modal.html
@@ -15,7 +15,12 @@
<p>There are some caveats regarding using modals on mobile devices. <a href="../getting-started/#support-fixed-position-keyboards">See our browser support docs</a> for details.</p>
</div>
- <p><strong class="text-danger">Due to how HTML5 defines its semantics, the <code>autofocus</code> HTML attribute has no effect in Bootstrap modals.</strong></p>
+ <p><strong class="text-danger">Due to how HTML5 defines its semantics, the <code>autofocus</code> HTML attribute has no effect in Bootstrap modals.</strong> To achieve the same effect, use some custom JavaScript:</p>
+ {% highlight js %}
+ $('#myModal').on('shown.bs.modal', function () {
+ $('#myInput').focus()
+ })
+ {% endhighlight %}
<h2 id="modals-examples">Examples</h2>