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:
parent
cad22335ed
commit
4527652177
@ -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()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user