mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 11:52:38 +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.computePosition([left, top])
|
||||||
}
|
}
|
||||||
this.container.querySelector('li > *').focus()
|
this.container.querySelector('li > *').focus()
|
||||||
this.container.addEventListener('keydown', (event) => {
|
this.container.addEventListener(
|
||||||
if (event.key === 'Escape') {
|
'keydown',
|
||||||
event.stopPropagation()
|
(event) => {
|
||||||
this.close()
|
if (event.key === 'Escape') {
|
||||||
}
|
event.stopPropagation()
|
||||||
})
|
this.close()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ once: true }
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
|
|
Loading…
Reference in a new issue