mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
remove text from input after submitting (scenario user), closes #237
This commit is contained in:
parent
51fafbf61b
commit
b7a1ec106b
1 changed files with 11 additions and 2 deletions
|
@ -107,6 +107,7 @@ class Scenario extends React.Component {
|
|||
importDashboardModal: false,
|
||||
modalDashboardData: {},
|
||||
|
||||
userToAdd: '',
|
||||
deleteUserName: '',
|
||||
deleteUserModal: false,
|
||||
}
|
||||
|
@ -139,13 +140,19 @@ class Scenario extends React.Component {
|
|||
* User modification methods
|
||||
############################################## */
|
||||
|
||||
onUserInputChange(e) {
|
||||
this.setState({userToAdd: e.target.value});
|
||||
}
|
||||
|
||||
addUser() {
|
||||
AppDispatcher.dispatch({
|
||||
type: 'scenarios/add-user',
|
||||
data: this.state.scenario.id,
|
||||
username: this.userToAdd,
|
||||
username: this.state.userToAdd,
|
||||
token: this.state.sessionToken
|
||||
});
|
||||
|
||||
this.setState({userToAdd: ''});
|
||||
}
|
||||
|
||||
closeDeleteUserModal() {
|
||||
|
@ -657,7 +664,9 @@ class Scenario extends React.Component {
|
|||
<InputGroup style={{ width: 400, float: 'right' }}>
|
||||
<FormControl
|
||||
placeholder="Username"
|
||||
onChange={(e) => this.userToAdd = e.target.value}
|
||||
onChange={(e) => this.onUserInputChange(e)}
|
||||
value={this.state.userToAdd}
|
||||
type="text"
|
||||
/>
|
||||
<InputGroup.Append>
|
||||
<Button
|
||||
|
|
Loading…
Add table
Reference in a new issue