mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-30 08:39:56 +02:00
Merge pull request #23890 from pat270/collapse-js-with-text-truncate
v4 Collapse.js: Accordions with text-truncate causes the page to jump on close
This commit is contained in:
@@ -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()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user