0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-01 13:24:25 +01:00

Collapse.js preventDefault if [data-toggle="collapse"] is an anchor tag

This commit is contained in:
Patrick Yeo 2017-09-08 14:53:15 -07:00
parent cad22335ed
commit 4527652177

View File

@ -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()
}