Skip to content

Commit 33a48a6

Browse files
author
Stanislav Idolov
authored
ENGCOM-3510: Binding to event collapsible scroll #18609
2 parents 82c2e44 + dd91e57 commit 33a48a6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/web/mage/collapsible.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ define([
6363
this.icons = true;
6464
}
6565

66+
this.element.on('dimensionsChanged', function (e) {
67+
if (e.target && e.target.classList.contains('active')) {
68+
this._scrollToTopIfVisible(e.target);
69+
}
70+
}.bind(this));
71+
6672
this._bind('click');
6773
this._trigger('created');
6874
},
@@ -453,9 +459,6 @@ define([
453459
if (this.options.animate) {
454460
this._animate(showProps);
455461
} else {
456-
if (this.content.length) {
457-
this._scrollToTopIfVisible(this.content.get(0).parentElement);
458-
}
459462
this.content.show();
460463
}
461464
this._open();

0 commit comments

Comments
 (0)