Added preventDefault (#3137)

This commit is contained in:
David Lu
2016-05-27 08:42:00 -07:00
committed by Joram Wilander
parent 0d8431b4ba
commit 24590b3e89
2 changed files with 2 additions and 0 deletions

View File

@@ -225,6 +225,7 @@ class CreateComment extends React.Component {
}
if ((e.ctrlKey || e.metaKey) && !e.altKey && !e.shiftKey && e.keyCode === KeyCodes.UP) {
e.preventDefault();
const lastPost = PostStore.getCurrentUsersLatestPost(this.props.channelId, this.props.rootId);
if (!lastPost) {
return;

View File

@@ -374,6 +374,7 @@ class CreatePost extends React.Component {
}
if ((e.ctrlKey || e.metaKey) && !e.altKey && !e.shiftKey && e.keyCode === KeyCodes.UP) {
e.preventDefault();
const channelId = ChannelStore.getCurrentId();
const lastPost = PostStore.getCurrentUsersLatestPost(channelId);
if (!lastPost) {