Skip to content

Commit

Permalink
Modal: drop loop (#38368)
Browse files Browse the repository at this point in the history
We only have two elements to iterate over so it doesn't make a lot of sense to use a loop here
  • Loading branch information
XhmikosR authored Mar 29, 2023
1 parent c953096 commit 7a7fc1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/src/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ class Modal extends BaseComponent {
}

dispose() {
for (const htmlElement of [window, this._dialog]) {
EventHandler.off(htmlElement, EVENT_KEY)
}
EventHandler.off(window, EVENT_KEY)
EventHandler.off(this._dialog, EVENT_KEY)

this._backdrop.dispose()
this._focustrap.deactivate()

super.dispose()
}

Expand Down

0 comments on commit 7a7fc1a

Please sign in to comment.