]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Update modal's `show` method to accept `relatedTarget` as an argument (#33300)
authorAnton <antonfedonjuk@gmail.com>
Tue, 16 Mar 2021 05:49:52 +0000 (08:49 +0300)
committerGitHub <noreply@github.com>
Tue, 16 Mar 2021 05:49:52 +0000 (07:49 +0200)
Co-authored-by: Rohit Sharma <rohit2sharma95@gmail.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
site/content/docs/5.0/components/modal.md

index 0abe0ce0f2fa30a04dea97937f611b7c58cb6d81..0f11614fdeaf0ba1a7458f9a611baaa6fd327b31 100644 (file)
@@ -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).