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:
Alex Andreev authored and GitHub committed 2020-09-10 09:31:23 +03:00
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)