Add onChange handlers & tabIndexes

This commit is contained in:
David Baker 2017-07-17 14:40:38 +01:00
parent f6f80bf9ce
commit a32113ad97

View file

@ -225,6 +225,27 @@ export default React.createClass({
}); });
}, },
_onNameChange: function(e) {
const newProfileForm = Object.assign(this.state.profileForm, { name: e.target.value });
this.setState({
profileForm: newProfileForm,
});
},
_onShortDescChange: function(e) {
const newProfileForm = Object.assign(this.state.profileForm, { short_description: e.target.value });
this.setState({
profileForm: newProfileForm,
});
},
_onLongDescChange: function(e) {
const newProfileForm = Object.assign(this.state.profileForm, { long_description: e.target.value });
this.setState({
profileForm: newProfileForm,
});
},
_onSaveClick: function() { _onSaveClick: function() {
}, },
@ -346,11 +367,13 @@ export default React.createClass({
value={this.state.profileForm.name} value={this.state.profileForm.name}
onChange={this._onNameChange} onChange={this._onNameChange}
placeholder={_t('Group Name')} placeholder={_t('Group Name')}
tabIndex="1"
/> />
shortDescNode = <input type="text" shortDescNode = <input type="text"
value={this.state.profileForm.short_description} value={this.state.profileForm.short_description}
onChange={this._onShortDescChange} onChange={this._onShortDescChange}
placeholder={_t('Description')} placeholder={_t('Description')}
tabIndex="2"
/> />
rightButtons = <span> rightButtons = <span>
<AccessibleButton className="mx_GroupView_saveButton mx_RoomHeader_textButton" onClick={this._onSaveClick}> <AccessibleButton className="mx_GroupView_saveButton mx_RoomHeader_textButton" onClick={this._onSaveClick}>
@ -365,6 +388,7 @@ export default React.createClass({
roomBody = <div> roomBody = <div>
<textarea className="mx_GroupView_editLongDesc" value={this.state.profileForm.long_description} <textarea className="mx_GroupView_editLongDesc" value={this.state.profileForm.long_description}
onChange={this._onLongDescChange} onChange={this._onLongDescChange}
tabIndex="3"
/> />
</div>; </div>;
} else { } else {