Skip to content

Commit

Permalink
fix ui friendliness
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasith Jayawardana committed Jun 16, 2018
1 parent 30b5a85 commit 8d8055c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/CarEntryDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ class CarEntryDialog extends React.Component<CombinedProps, OwnState> {
return { id: 0, manufacturer: "", make: "", model: "", year: 2018 };
};

initState = () => {
this.setState({newCar : this.newCarState()});
}

handleEntry = event => {
let id = this.state.newCar.id;
let manufacturer = this.refs.manufacturer["value"];
Expand All @@ -66,6 +70,7 @@ class CarEntryDialog extends React.Component<CombinedProps, OwnState> {
model,
year
});
this.initState();
};

getTitle = () =>
Expand Down Expand Up @@ -118,6 +123,7 @@ class CarEntryDialog extends React.Component<CombinedProps, OwnState> {
type="button"
className="close"
data-dismiss="modal"
onClick={(event) => this.initState()}
aria-label="Close"
>
<span aria-hidden="true">&times;</span>
Expand Down Expand Up @@ -191,6 +197,7 @@ class CarEntryDialog extends React.Component<CombinedProps, OwnState> {
<button
type="button"
className="btn btn-secondary px-3"
onClick={(event) => this.initState()}
data-dismiss="modal"
>
Close
Expand Down

0 comments on commit 8d8055c

Please sign in to comment.