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
Этот коммит содержится в:
Mike Piccolo
2016-11-04 06:14:19 -07:00
коммит произвёл Harrison Healey
родитель f79f607a47
Коммит dbdd719c51
4 изменённых файлов: 39 добавлений и 7 удалений

Просмотреть файл

@@ -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
};