Skip to content

Commit 9f37e27

Browse files
committed
Ah rest of that dead handler removal
1 parent db0eceb commit 9f37e27

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

components/gui/alert/AlertContainer.js

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { sharedModalStyles } from '../modal.css.js'
1212
class AlertContainer extends HTMLElement {
1313
#screenLockingSection
1414
#alertQueue = []
15-
#keydownHandler
1615
/** @type {CleanupRegistry} Registry for cleanup handlers */
1716
cleanup = new CleanupRegistry()
1817

@@ -98,27 +97,10 @@ class AlertContainer extends HTMLElement {
9897
}
9998
this.#screenLockingSection.addEventListener('cancel', cancelHandler)
10099

101-
// Attach keyboard handler for Enter key
102-
if (this.#keydownHandler) {
103-
document.removeEventListener('keydown', this.#keydownHandler)
104-
}
105-
this.#keydownHandler = (e) => this.#handleKeydown(e)
106-
document.addEventListener('keydown', this.#keydownHandler)
107-
108100
// Store cancel handler so it can be removed on dismiss
109101
current.cancelHandler = cancelHandler
110102
}
111103

112-
/**
113-
* Handle keyboard events for alerts.
114-
* - Enter: dismiss current alert
115-
* (Escape is handled via native dialog cancel event)
116-
*/
117-
#handleKeydown(e) {
118-
const current = this.#alertQueue[0]
119-
if (!current) return
120-
}
121-
122104
/**
123105
* Dismiss the current alert and show the next one in queue.
124106
*/
@@ -134,12 +116,6 @@ class AlertContainer extends HTMLElement {
134116

135117
current.elem.dismiss()
136118

137-
// Remove keyboard handler
138-
if (this.#keydownHandler) {
139-
document.removeEventListener('keydown', this.#keydownHandler)
140-
this.#keydownHandler = null
141-
}
142-
143119
// Show next alert in queue if available
144120
if (this.#alertQueue.length > 0) {
145121
setTimeout(() => this.#showCurrent(), 600) // Wait for dismiss animation

0 commit comments

Comments
 (0)