chat: toggle input out of code mode after sending

Closes #2836. Code input would stick after sending a code message, so we
now toggle out of it if we were in it, on enter.
This commit is contained in:
Matilde Park 2020-05-04 13:29:47 -04:00
parent 40378d2b79
commit 6a10987602

View File

@ -319,8 +319,12 @@ export class ChatInput extends Component {
extraKeys: {
Tab: cm =>
this.patpAutocomplete(cm.getValue(), true),
'Enter': cm =>
this.messageSubmit(),
'Enter': () => {
this.messageSubmit();
if (this.state.code) {
this.toggleCode();
}
},
'Shift-3': cm =>
cm.getValue().length === 0
? this.toggleCode()