mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-05-24 14:04:09 +03:00
Collapse.js preventDefault if [data-toggle="collapse"] is an anchor tag
This commit is contained in:
+1
-1
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user