Merge pull request #71 from life777/master

Prevent closing comment input field on ESC
This commit is contained in:
Igor Adamenko
2018-06-09 21:33:07 +03:00
committed by GitHub
2 changed files with 3 additions and 7 deletions
-5
View File
@@ -65,11 +65,6 @@ export default class Input extends Component {
if (e.keyCode === 13 && (e.metaKey || e.ctrlKey)) {
this.send();
}
// cancel on esc
if (e.keyCode === 27 && this.props.onCancel) {
this.props.onCancel();
}
}
onInput() {
+3 -2
View File
@@ -83,9 +83,10 @@
function receiveMessages(event) {
try {
const data = typeof event.data === 'string' ? JSON.parse(event.data) : event.data;
const isItHash = data.hash && data.hash.indexOf("#") === 0;
if (data.hash) {
location.hash = data.hash;
if (isItHash) {
location.replace(data.hash);
}
} catch (e) {}
}