Skip to content

Commit 7a7fc1a

Browse files
authored
Modal: drop loop (#38368)
We only have two elements to iterate over so it doesn't make a lot of sense to use a loop here
1 parent c953096 commit 7a7fc1a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

js/src/modal.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@ class Modal extends BaseComponent {
139139
}
140140

141141
dispose() {
142-
for (const htmlElement of [window, this._dialog]) {
143-
EventHandler.off(htmlElement, EVENT_KEY)
144-
}
142+
EventHandler.off(window, EVENT_KEY)
143+
EventHandler.off(this._dialog, EVENT_KEY)
145144

146145
this._backdrop.dispose()
147146
this._focustrap.deactivate()
147+
148148
super.dispose()
149149
}
150150

0 commit comments

Comments
 (0)