diff options
author | Vitaly Takmazov | 2018-08-24 17:27:09 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:53 +0300 |
commit | 00d5a8dc3983b1b5911c7279394ebdac564a798e (patch) | |
tree | 501edf4dda5cf1ddbaa8023d2487e5d52928d14d /vnext/src/components/MessageInput.js | |
parent | aa52bb339a6016e8ed7833b9abaa4e0abb7f2351 (diff) |
scroll fixes for mobile
Diffstat (limited to 'vnext/src/components/MessageInput.js')
-rw-r--r-- | vnext/src/components/MessageInput.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/vnext/src/components/MessageInput.js b/vnext/src/components/MessageInput.js index 4fea2b57..4b3a0fd4 100644 --- a/vnext/src/components/MessageInput.js +++ b/vnext/src/components/MessageInput.js @@ -46,7 +46,10 @@ export default class MessageInput extends React.Component { } componentDidMount() { - this.textarea.current.focus(); + const isMobile = window.matchMedia('only screen and (max-width: 850px)'); + if (!isMobile.matches) { + this.textarea.current.focus(); + } } textChanged = (event) => { this.setState({ @@ -77,8 +80,8 @@ export default class MessageInput extends React.Component { <form className="msg-comment-target"> <div style={commentStyle}> <textarea name="body" onChange={this.textChanged} onKeyPress={this.handleCtrlEnter} - ref={this.textarea} style={textInputStyle} value={this.state.body} - rows={this.props.rows || '1'} placeholder={this.props.children} /> + ref={this.textarea} style={textInputStyle} value={this.state.body} + rows={this.props.rows || '1'} placeholder={this.props.children} /> <div style={inputBarStyle}> <div style={this.state.attach ? activeStyle : inactiveStyle} onClick={this.openfile}> @@ -87,7 +90,7 @@ export default class MessageInput extends React.Component { style={{ display: 'none' }} ref={this.fileinput} value={this.state.attach} onChange={this.attachmentChanged} /> </div> - <Button onClick={this.onSubmit}><Icon name="ei-envelope" size="s"/>Send</Button> + <Button onClick={this.onSubmit}><Icon name="ei-envelope" size="s" />Send</Button> </div> </div> </form> |