aboutsummaryrefslogtreecommitdiff
path: root/js/src/util/component-functions.js
diff options
context:
space:
mode:
authorJohann-S <[email protected]>2021-02-17 08:22:44 +0100
committerJohann-S <[email protected]>2021-09-15 16:42:04 +0200
commitd73d835380f793ab7ca40b82a6ce09ba8f5946c5 (patch)
tree7c98a87a596ae937983498980afb6e2fa239ab53 /js/src/util/component-functions.js
parentbdfb4cc54d29c0c7bcd7944d3c8de2e1cd41bb6c (diff)
downloadbootstrap-jo-ssr-friendly.tar.xz
bootstrap-jo-ssr-friendly.zip
being ssr friendly when accessing dom objectsjo-ssr-friendly
Diffstat (limited to 'js/src/util/component-functions.js')
-rw-r--r--js/src/util/component-functions.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/js/src/util/component-functions.js b/js/src/util/component-functions.js
index ff9d87ee6..6c31fad5c 100644
--- a/js/src/util/component-functions.js
+++ b/js/src/util/component-functions.js
@@ -6,13 +6,13 @@
*/
import EventHandler from '../dom/event-handler'
-import { getElementFromSelector, isDisabled } from './index'
+import { getElementFromSelector, isDisabled, getDocument } from './index'
const enableDismissTrigger = (component, method = 'hide') => {
const clickEvent = `click.dismiss${component.EVENT_KEY}`
const name = component.NAME
- EventHandler.on(document, clickEvent, `[data-bs-dismiss="${name}"]`, function (event) {
+ EventHandler.on(getDocument(), clickEvent, `[data-bs-dismiss="${name}"]`, function (event) {
if (['A', 'AREA'].includes(this.tagName)) {
event.preventDefault()
}