Commit 5245bafb authored by XhmikosR's avatar XhmikosR
Browse files

Merge pull request #15135 from hillai/patch-1

Add modal autofocus example
parents 939e759f 0ada807c
Showing with 6 additions and 1 deletion
+6 -1
......@@ -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>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment