0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Updated esc key handling on iframe

no issue

- Updates the key event on owner document from the node
This commit is contained in:
Rish 2020-09-08 18:29:34 +05:30
parent c90a947d94
commit 62d572613f

View file

@ -51,14 +51,14 @@ class PopupContent extends React.Component {
this.context.onAction('closePopup');
}
};
this.node.removeEventListener('keyup', this.keyUphandler);
this.node.addEventListener('keyup', this.keyUphandler);
this.node.ownerDocument.removeEventListener('keyup', this.keyUphandler);
this.node.ownerDocument.addEventListener('keyup', this.keyUphandler);
}
}
componentWillUnmount() {
if (this.node) {
this.node.removeEventListener('keyup', this.keyUphandler);
this.node.ownerDocument.removeEventListener('keyup', this.keyUphandler);
}
}