diff options
Diffstat (limited to 'vnext/src/components/MessageInput.js')
-rw-r--r-- | vnext/src/components/MessageInput.js | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/vnext/src/components/MessageInput.js b/vnext/src/components/MessageInput.js index 6e698c32..e30962a8 100644 --- a/vnext/src/components/MessageInput.js +++ b/vnext/src/components/MessageInput.js @@ -9,12 +9,6 @@ import Button from './Button'; export default class MessageInput extends React.Component { constructor(props) { super(props) - this.textChanged = this.textChanged.bind(this); - this.attachmentChanged = this.attachmentChanged.bind(this); - this.openfile = this.openfile.bind(this); - this.handleCtrlEnter = this.handleCtrlEnter.bind(this); - this.onSubmit = this.onSubmit.bind(this); - this.textarea = React.createRef(); this.fileinput = React.createRef(); this.state = { @@ -26,13 +20,13 @@ export default class MessageInput extends React.Component { } } - handleCtrlEnter(event) { + handleCtrlEnter = (event) => { if (event.ctrlKey && (event.charCode == 10 || event.charCode == 13)) { this.onSubmit({}) } } - onSubmit(event) { + onSubmit = (event) => { if (event.preventDefault) event.preventDefault(); const input = this.fileinput.current; this.props.onSend({ @@ -50,7 +44,7 @@ export default class MessageInput extends React.Component { componentDidMount() { this.textarea.current.focus() } - textChanged(event) { + textChanged = (event) => { this.setState({ body: event.target.value }) @@ -59,12 +53,12 @@ export default class MessageInput extends React.Component { const height = el.scrollHeight + offset; el.style.height = `${height + offset}px`; } - attachmentChanged(event) { + attachmentChanged = (event) => { this.setState({ attach: event.target.value }) } - openfile() { + openfile = () => { const input = this.fileinput.current; if (this.state.attach) { this.setState({ |