Fix the stats for nerds modal hogging all the keyboard events (#2253)

This commit is contained in:
absidue 2022-05-22 13:59:49 +02:00 committed by GitHub
parent d34720aeb3
commit 32b9e1d511
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -1439,6 +1439,13 @@ export default Vue.extend({
temporary: false, temporary: false,
pauseOnOpen: false pauseOnOpen: false
}) })
this.statsModal.handleKeyDown_ = (event) => {
// the default handler prevents keyboard events propagating beyond the modal
// the modal should only handle the escape and tab key, all others should be handled by the player
if (event.key === 'Escape' || event.key === 'Tab') {
this.statsModal.handleKeyDown(event)
}
}
this.player.addChild(this.statsModal) this.player.addChild(this.statsModal)
this.statsModal.el_.classList.add('statsModal') this.statsModal.el_.classList.add('statsModal')
this.statsModal.on('modalclose', () => { this.statsModal.on('modalclose', () => {