mirror of
https://github.com/urbit/shrub.git
synced 2024-12-23 19:05:48 +03:00
Merge pull request #4836 from urbit/james/chat-input-fixes
chat: input behavior quirks
This commit is contained in:
commit
3616673cae
@ -74,6 +74,8 @@ class ChatInput extends Component<ChatInputProps, ChatInputState> {
|
|||||||
} else {
|
} else {
|
||||||
onSubmit(tokenizeMessage(text));
|
onSubmit(tokenizeMessage(text));
|
||||||
}
|
}
|
||||||
|
this.chatEditor.current.editor.focus();
|
||||||
|
this.setState({ currentInput: '' });
|
||||||
}
|
}
|
||||||
|
|
||||||
uploadSuccess(url: string) {
|
uploadSuccess(url: string) {
|
||||||
|
@ -240,17 +240,12 @@ export default class ChatEditor extends Component {
|
|||||||
rows="1"
|
rows="1"
|
||||||
style={{ width: '100%', background: 'transparent', color: 'currentColor' }}
|
style={{ width: '100%', background: 'transparent', color: 'currentColor' }}
|
||||||
placeholder={inCodeMode ? "Code..." : "Message..."}
|
placeholder={inCodeMode ? "Code..." : "Message..."}
|
||||||
onChange={event => {
|
onChange={event =>
|
||||||
this.messageChange(null, null, event.target.value);
|
this.messageChange(null, null, event.target.value)
|
||||||
}}
|
}
|
||||||
onKeyDown={event => {
|
onKeyDown={event =>
|
||||||
if (event.key === 'Enter') {
|
this.messageChange(null, null, event.target.value)
|
||||||
event.preventDefault();
|
}
|
||||||
this.submit();
|
|
||||||
} else {
|
|
||||||
this.messageChange(null, null, event.target.value);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
ref={input => {
|
ref={input => {
|
||||||
if (!input) return;
|
if (!input) return;
|
||||||
this.editor = inputProxy(input);
|
this.editor = inputProxy(input);
|
||||||
|
Loading…
Reference in New Issue
Block a user