aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton <[email protected]>2021-03-16 08:49:52 +0300
committerGitHub <[email protected]>2021-03-16 07:49:52 +0200
commitaf42557f4a8eb69bd098869d0f29f4c456c95063 (patch)
tree603ca78a05c34e56e9cb7278b4da31703704da5e
parent99b2c0b390660b2032c3129b8ebff02fa1e034c9 (diff)
downloadbootstrap-af42557f4a8eb69bd098869d0f29f4c456c95063.tar.xz
bootstrap-af42557f4a8eb69bd098869d0f29f4c456c95063.zip
Update modal's `show` method to accept `relatedTarget` as an argument (#33300)
Co-authored-by: Rohit Sharma <[email protected]> Co-authored-by: XhmikosR <[email protected]>
-rw-r--r--site/content/docs/5.0/components/modal.md7
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 0abe0ce0f..0f11614fd 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).