mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fixing Dialog Escape keypress behavior (#831)
* Replacing dialog keypress target Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Adding explanatory comments Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
1 parent
8d1f0efe80
commit
e11cbc19fe
4 files changed
+6
-5
No files matched your search
@@ -40,6 +40,7 @@ export class Drawer extends React.Component<DrawerProps> {
|
||||
});
|
||||
|
||||
componentDidMount() {
|
||||
// Using window target for events to make sure they will be catched after other places (e.g. Dialog)
|
||||
window.addEventListener("mousedown", this.onMouseDown)
|
||||
window.addEventListener("click", this.onClickOutside)
|
||||
window.addEventListener("keydown", this.onEscapeKey)
|
||||
|
||||
Reference in new issue
Block a user