mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 03:42:37 +02:00
fix: listen just once for escape key in contextmenu
This commit is contained in:
parent
1029c2655e
commit
6876bb1ba5
1 changed files with 10 additions and 6 deletions
|
@ -43,12 +43,16 @@ export default class ContextMenu extends Positioned {
|
|||
this.computePosition([left, top])
|
||||
}
|
||||
this.container.querySelector('li > *').focus()
|
||||
this.container.addEventListener('keydown', (event) => {
|
||||
if (event.key === 'Escape') {
|
||||
event.stopPropagation()
|
||||
this.close()
|
||||
}
|
||||
})
|
||||
this.container.addEventListener(
|
||||
'keydown',
|
||||
(event) => {
|
||||
if (event.key === 'Escape') {
|
||||
event.stopPropagation()
|
||||
this.close()
|
||||
}
|
||||
},
|
||||
{ once: true }
|
||||
)
|
||||
}
|
||||
|
||||
close() {
|
||||
|
|
Loading…
Reference in a new issue