diff options
| author | XhmikosR <[email protected]> | 2014-11-16 17:42:05 +0200 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2014-11-16 17:42:05 +0200 |
| commit | 5245bafb928f23930d50fa5bf3389638e5273f88 (patch) | |
| tree | 12fedd7ee5c1185110993b461bab0bcad6430ede /docs/_includes | |
| parent | 939e759f69f2afb83be563a14d0df323db83b14b (diff) | |
| parent | 0ada807ce6b99b95ce159a6b236309ab0ac425b3 (diff) | |
| download | bootstrap-5245bafb928f23930d50fa5bf3389638e5273f88.tar.xz bootstrap-5245bafb928f23930d50fa5bf3389638e5273f88.zip | |
Merge pull request #15135 from hillai/patch-1
Add modal autofocus example
Diffstat (limited to 'docs/_includes')
| -rw-r--r-- | docs/_includes/js/modal.html | 7 |
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> |
