mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-26 23:54:23 +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) {
|
$(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
|
// 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()
|
event.preventDefault()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user