commit f34ed06be95c30deba95c8bf53418d1a6c0388e5
parent a3923cc4f812b2e5828652cb405d79fca1ce5b4e
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Sat, 25 Feb 2017 21:14:44 +0300
fixed hiding contexrmenu on esc key press
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/lib/contextmenu/index.js b/src/lib/contextmenu/index.js
@@ -47,7 +47,7 @@ class Contextmenu {
container.className = 'contextmenu';
container.style.zIndex = 10000;
- window.addEventListener('keydown', this.onKeyDown);
+ window.addEventListener('keydown', this.onKeyDown, true);
window.addEventListener('mousedown', this.onMouseDown, true);
for (let item of this.createItems()) {
@@ -63,7 +63,7 @@ class Contextmenu {
document.body.removeChild(this._container);
this._container = null;
- window.removeEventListener('keydown', this.onKeyDown);
+ window.removeEventListener('keydown', this.onKeyDown, true);
window.removeEventListener('mousedown', this.onMouseDown, true);
}