1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-08 21:42:24 +03:00

fix: autocomplete to use tab instead of return

This commit is contained in:
Aviral Dasgupta
2016-08-03 17:51:40 +05:30
parent f431e62e6b
commit 1f9a396fa5
2 changed files with 4 additions and 17 deletions

View File

@@ -422,12 +422,6 @@ export default class MessageComposerInput extends React.Component {
if (ev.shiftKey) {
return false;
}
if(this.props.tryComplete) {
if(this.props.tryComplete()) {
return true;
}
}
const contentState = this.state.editorState.getCurrentContent();
if (!contentState.hasText()) {
@@ -519,8 +513,8 @@ export default class MessageComposerInput extends React.Component {
}
onTab(e) {
if (this.props.onTab) {
if (this.props.onTab()) {
if (this.props.tryComplete) {
if (this.props.tryComplete()) {
e.preventDefault();
}
}
@@ -585,5 +579,6 @@ MessageComposerInput.propTypes = {
onDownArrow: React.PropTypes.func,
onTab: React.PropTypes.func
// attempts to confirm currently selected completion, returns whether actually confirmed
tryComplete: React.PropTypes.func,
};