We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 38df7c8 commit fd0c08eCopy full SHA for fd0c08e
core/shortcut_registry.ts
@@ -278,7 +278,9 @@ export class ShortcutRegistry {
278
* Undefined if no shortcuts exist.
279
*/
280
getShortcutNamesByKeyCode(keyCode: string): string[] | undefined {
281
- return this.keyMap.get(keyCode) || [];
+ // Copy the list of shortcuts in case one of them unregisters itself
282
+ // in its callback.
283
+ return this.keyMap.get(keyCode)?.slice() || [];
284
}
285
286
/**
0 commit comments