PLT-5208: Trigger Invitation by pressing Enter (#5305)

Этот коммит содержится в:
Robin Naundorf
2017-02-13 16:50:25 +01:00
коммит произвёл Corey Hulen
родитель 54c699b7ca
Коммит 260f1111e8

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

@@ -58,6 +58,7 @@ class InviteMemberModal extends React.Component {
this.clearFields = this.clearFields.bind(this); this.clearFields = this.clearFields.bind(this);
this.removeInviteFields = this.removeInviteFields.bind(this); this.removeInviteFields = this.removeInviteFields.bind(this);
this.showGetTeamInviteLinkModal = this.showGetTeamInviteLinkModal.bind(this); this.showGetTeamInviteLinkModal = this.showGetTeamInviteLinkModal.bind(this);
this.handleKeyDown = this.handleKeyDown.bind(this);
const team = TeamStore.getCurrent(); const team = TeamStore.getCurrent();
@@ -234,6 +235,13 @@ class InviteMemberModal extends React.Component {
GlobalActions.showGetTeamInviteLinkModal(); GlobalActions.showGetTeamInviteLinkModal();
} }
handleKeyDown(e) {
if (e.keyCode === Constants.KeyCodes.ENTER) {
e.preventDefault();
this.handleSubmit();
}
}
render() { render() {
var currentUser = UserStore.getCurrentUser(); var currentUser = UserStore.getCurrentUser();
const {formatMessage} = this.props.intl; const {formatMessage} = this.props.intl;
@@ -290,6 +298,7 @@ class InviteMemberModal extends React.Component {
<div className='col-sm-6'> <div className='col-sm-6'>
<div className={firstNameClass}> <div className={firstNameClass}>
<input <input
onKeyDown={this.handleKeyDown}
type='text' type='text'
className='form-control' className='form-control'
ref={'first_name' + index} ref={'first_name' + index}
@@ -304,6 +313,7 @@ class InviteMemberModal extends React.Component {
<div className='col-sm-6'> <div className='col-sm-6'>
<div className={lastNameClass}> <div className={lastNameClass}>
<input <input
onKeyDown={this.handleKeyDown}
type='text' type='text'
className='form-control' className='form-control'
ref={'last_name' + index} ref={'last_name' + index}
@@ -324,6 +334,7 @@ class InviteMemberModal extends React.Component {
<div className={emailClass}> <div className={emailClass}>
<input <input
onKeyUp={this.displayNameKeyUp} onKeyUp={this.displayNameKeyUp}
onKeyDown={this.handleKeyDown}
type='text' type='text'
ref={'email' + index} ref={'email' + index}
className='form-control' className='form-control'