Skip to content

Commit b705a20

Browse files
committed
Fix event dispatching on treeview
1 parent 3a7c4f6 commit b705a20

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/ts/treeview.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,8 @@ class Treeview {
7878
if (childElement) {
7979
this._element.classList.add(CLASS_NAME_MENU_OPEN)
8080
slideDown(childElement, this._config.animationSpeed)
81+
this._element.dispatchEvent(event)
8182
}
82-
83-
this._element.dispatchEvent(event)
8483
}
8584

8685
close(): void {
@@ -90,9 +89,8 @@ class Treeview {
9089
if (childElement) {
9190
this._element.classList.remove(CLASS_NAME_MENU_OPEN)
9291
slideUp(childElement, this._config.animationSpeed)
92+
this._element.dispatchEvent(event)
9393
}
94-
95-
this._element.dispatchEvent(event)
9694
}
9795

9896
toggle(): void {

0 commit comments

Comments
 (0)