diff options
author | Anton <antonfedonjuk@gmail.com> | 2021-03-16 08:49:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-16 08:49:52 +0300 |
commit | af42557f4a8eb69bd098869d0f29f4c456c95063 (patch) | |
tree | 603ca78a05c34e56e9cb7278b4da31703704da5e /site | |
parent | 99b2c0b390660b2032c3129b8ebff02fa1e034c9 (diff) |
Update modal's `show` method to accept `relatedTarget` as an argument (#33300)
Co-authored-by: Rohit Sharma <rohit2sharma95@gmail.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Diffstat (limited to 'site')
-rw-r--r-- | site/content/docs/5.0/components/modal.md | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/site/content/docs/5.0/components/modal.md b/site/content/docs/5.0/components/modal.md index 0abe0ce0f2..0f11614fde 100644 --- a/site/content/docs/5.0/components/modal.md +++ b/site/content/docs/5.0/components/modal.md @@ -892,6 +892,13 @@ Manually opens a modal. **Returns to the caller before the modal has actually be myModal.show() ``` +Also, you can pass a DOM element as an argument that can be received in the modal events (as the `relatedTarget` property). + +```js +var modalToggle = document.getElementById('toggleMyModal') // relatedTarget +myModal.show(modalToggle) +``` + #### hide Manually hides a modal. **Returns to the caller before the modal has actually been hidden** (i.e. before the `hidden.bs.modal` event occurs). |