Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent extra enter after submitting message
* Check _onChange so not set the state to the "\n". * Seems that setting state from _onKeyDown triggers rendering, with state set to '', but then the _onChange event is called, somehow with the event.target.value set "\n". * Is there some way to stop event propagation in the _onKeyDown? * Tried event.stopPropgation in _onKeyDown, but that didn't work.
- Loading branch information
643ca19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirmed that I could combine the two event handlers like this. However, I'm not changeing the code, as using the _onKeyDown seems correct if ones wants to trap the shift-enter to allow embedded returns.