diff options
author | Mike Piccolo <mfpiccolo@gmail.com> | 2016-11-04 06:14:19 -0700 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-11-04 09:14:19 -0400 |
commit | dbdd719c51d061dfc327644d4b2ca89a0595b4f1 (patch) | |
tree | 1ddeffb36b94b5719e29a9595994423d78ab1791 /webapp/components/textbox.jsx | |
parent | f79f607a47e4b833b9eadec44b9c94b5f21b66ef (diff) | |
download | chat-dbdd719c51d061dfc327644d4b2ca89a0595b4f1.tar.gz chat-dbdd719c51d061dfc327644d4b2ca89a0595b4f1.tar.bz2 chat-dbdd719c51d061dfc327644d4b2ca89a0595b4f1.zip |
PLT-4376 iOS and Android: Keep the keyboard open after sending a message (#4377)
* Force keyboard to retain focus on submitting post on mobile
* Fix lint error
* Allow keyboard to stay closed if the keyboard was closed earlier before submitting
* Increase delay time and add to comment
* Remove pass through props on suggestion box
Diffstat (limited to 'webapp/components/textbox.jsx')
-rw-r--r-- | webapp/components/textbox.jsx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/webapp/components/textbox.jsx b/webapp/components/textbox.jsx index 4a4a854f3..f11ef20ad 100644 --- a/webapp/components/textbox.jsx +++ b/webapp/components/textbox.jsx @@ -29,6 +29,7 @@ export default class Textbox extends React.Component { this.onRecievedError = this.onRecievedError.bind(this); this.handleKeyPress = this.handleKeyPress.bind(this); this.handleKeyDown = this.handleKeyDown.bind(this); + this.handleBlur = this.handleBlur.bind(this); this.handleHeightChange = this.handleHeightChange.bind(this); this.showPreview = this.showPreview.bind(this); @@ -84,6 +85,12 @@ export default class Textbox extends React.Component { } } + handleBlur(e) { + if (this.props.onBlur) { + this.props.onBlur(e); + } + } + handleHeightChange(height) { const textbox = $(this.refs.message.getTextbox()); const wrapper = $(this.refs.wrapper); @@ -209,6 +216,7 @@ export default class Textbox extends React.Component { onChange={this.props.onChange} onKeyPress={this.handleKeyPress} onKeyDown={this.handleKeyDown} + onBlur={this.handleBlur} onHeightChange={this.handleHeightChange} style={{visibility: this.state.preview ? 'hidden' : 'visible'}} listComponent={SuggestionList} @@ -255,5 +263,6 @@ Textbox.propTypes = { onKeyPress: React.PropTypes.func.isRequired, createMessage: React.PropTypes.string.isRequired, onKeyDown: React.PropTypes.func, + onBlur: React.PropTypes.func, supportsCommands: React.PropTypes.bool.isRequired }; |