You've already forked matrix-react-sdk
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:
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user