Permalink
Browse files

Use FormEditWrapper to buffer changes from Pilot inputs

  • Loading branch information...
markerikson committed Jan 7, 2017
1 parent dad0aa7 commit bee1c966ea9cfb67448c79be4039891fe9921fee
Showing with 30 additions and 18 deletions.
  1. +30 −18 src/features/pilots/PilotDetails/PilotDetails.jsx
@@ -4,6 +4,8 @@ import {Form, Dropdown, Grid, Button} from "semantic-ui-react";
import schema from "app/schema";
import FormEditWrapper from "common/components/FormEditWrapper";
import {selectCurrentPilot, selectIsEditingPilot} from "../pilotsSelectors";
import {
@@ -103,16 +105,21 @@ export class PilotDetails extends Component {
return (
<Form size="large">
<Form.Field
name="name"
label="Name"
width={16}
placeholder="Name"
value={name}
disabled={!canStopEditing}
<FormEditWrapper
singleValue={true}
value={ {name} }
onChange={this.onInputChanged}
control="input"
/>
passIsEditing={false}
>
<Form.Field
name="name"
label="Name"
width={16}
placeholder="Name"
disabled={!canStopEditing}
control="input"
/>
</FormEditWrapper>
<Form.Field
name="rank"
label="Rank"
@@ -125,16 +132,21 @@ export class PilotDetails extends Component {
onChange={this.onDropdownChanged}
disabled={!canStopEditing}
/>
<Form.Field
name="age"
width={6}
label="Age"
placeholder="Age"
control="input"
value={age}
<FormEditWrapper
singleValue={true}
value={ {age} }
onChange={this.onInputChanged}
disabled={!canStopEditing}
/>
passIsEditing={false}
>
<Form.Field
name="age"
width={6}
label="Age"
placeholder="Age"
control="input"
disabled={!canStopEditing}
/>
</FormEditWrapper>
<Form.Field
name="gunnery"
label="Gunnery"

0 comments on commit bee1c96

Please sign in to comment.