diff --git a/pkg/interface/link/src/js/components/link.js b/pkg/interface/link/src/js/components/link.js index 803c287ee8..488f1bd47e 100644 --- a/pkg/interface/link/src/js/components/link.js +++ b/pkg/interface/link/src/js/components/link.js @@ -130,6 +130,12 @@ export class LinkDetail extends Component { }} placeholder="Leave a comment on this link" onChange={this.setComment} + onKeyPress={(e) => { + if ((e.getModifierState("Control") || event.getModifierState("Meta")) + && e.key === "Enter") { + this.onClickPost(); + } + }} onFocus={() => this.setState({commentFocus: true})} onBlur={() => this.setState({commentFocus: false})} value={this.state.comment} diff --git a/pkg/interface/publish/src/js/components/lib/comments.js b/pkg/interface/publish/src/js/components/lib/comments.js index c6e20921cd..14583f6588 100644 --- a/pkg/interface/publish/src/js/components/lib/comments.js +++ b/pkg/interface/publish/src/js/components/lib/comments.js @@ -116,7 +116,13 @@ export class Comments extends Component { "b--gray2-d mb2 focus-b--black focus-b--white-d white-d bg-gray0-d"} aria-describedby="comment-desc" style={{height: "4rem"}} - onChange={this.commentChange}> + onChange={this.commentChange} + onKeyPress={(e) => { + if ((e.getModifierState("Control") || event.getModifierState("Meta")) + && e.key === "Enter") { + this.commentSubmit(); + } + }}>