Commit 88bd3d50 by Trevor Austin

Submit posts in example with enter key

parent 748d1819
Showing with 4 additions and 0 deletions
......@@ -45,6 +45,10 @@ class Journal extends React.Component {
postListener = (event) => {
// TODO: Listen for the Enter Key
console.log("KeyCode: " +event.key);
if(event.key === 'Enter' && !event.shiftKey) {
this.postHandler(event);
event.preventDefault();
}
}
postHandler = (event) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment