MCPcopy Create free account
hub / github.com/TanStack/hotkeys / _registerModalHotkeys

Method _registerModalHotkeys

examples/lit/hotkey/src/app.ts:171–196  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

169 }
170
171 private _registerModalHotkeys(): void {
172 const manager = getHotkeyManager()
173 const modal = this.modalRef.value
174 if (!modal) return
175
176 this._modalRegistrations.push(
177 manager.register(
178 'Escape',
179 () => {
180 this.lastHotkey = 'Escape'
181 this.modalShortcutCount++
182 this.modalOpen = false
183 },
184 { target: modal },
185 ),
186 manager.register(
187 'Mod+Enter',
188 () => {
189 this.lastHotkey = 'Mod+Enter'
190 this.modalShortcutCount++
191 alert('Modal submit shortcut!')
192 },
193 { target: modal },
194 ),
195 )
196 }
197
198 render() {
199 return html` <div class="app">

Callers 1

updatedMethod · 0.95

Calls 2

getHotkeyManagerFunction · 0.85
registerMethod · 0.45

Tested by

no test coverage detected