diff options
author | 2018-06-25 13:02:30 +0300 | |
---|---|---|
committer | 2023-01-13 10:37:53 +0300 | |
commit | 28679bfba2d4160cd54fe368e5412aa622cd8c6e (patch) | |
tree | a532f4074a9492733a9bad67ed552d8bf18bb3ee /vnext/src/components/MessageInput.js | |
parent | cfc03954dcc9d4446e5993c6cdfb5e7e73d71a71 (diff) |
transform-class-properties
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({ |