aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorPatrick Yeo <[email protected]>2017-09-08 14:53:15 -0700
committerPatrick Yeo <[email protected]>2017-09-08 14:53:15 -0700
commit45276521778c9843c3d308f7fcda4168a75f4825 (patch)
treef1e7191217e53daac4184e8fb592fb2481a5148b /js
parentcad22335ede2d2d9d0242f86cd859752bbfb14ea (diff)
downloadbootstrap-45276521778c9843c3d308f7fcda4168a75f4825.tar.xz
bootstrap-45276521778c9843c3d308f7fcda4168a75f4825.zip
Collapse.js preventDefault if `[data-toggle="collapse"]` is an anchor tag
Diffstat (limited to 'js')
-rw-r--r--js/src/collapse.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/js/src/collapse.js b/js/src/collapse.js
index acc959d40..bf9c990ec 100644
--- a/js/src/collapse.js
+++ b/js/src/collapse.js
@@ -363,7 +363,7 @@ const Collapse = (() => {
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
// preventDefault only for <a> elements (which change the URL) not inside the collapsible element
- if (event.target.tagName === 'A' && !$.contains(this, event.target)) {
+ if (event.currentTarget.tagName === 'A') {
event.preventDefault()
}