Skip to content

Commit

Permalink
fix(EditableCell): Change behavior to save cell contents when losing …
Browse files Browse the repository at this point in the history
…focus, clicking away etc.

fix #562
  • Loading branch information
binh-dam-ibigroup committed Apr 23, 2020
1 parent 017a634 commit 9a31e89
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/editor/components/timetable/EditableCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ export default class EditableCell extends Component<Props, State> {
}
}

handleBlur = () => {
this.save()
}

handleChange = (evt: SyntheticInputEvent<HTMLInputElement>) => {
this.setState({data: evt.target.value})
}
Expand Down Expand Up @@ -335,7 +339,7 @@ export default class EditableCell extends Component<Props, State> {
autoFocus
defaultValue={renderCell(column, data)}
className='cell-input'
onBlur={this.cancel}
onBlur={this.handleBlur}
onChange={this.handleChange}
onFocus={this._onInputFocus}
onKeyDown={this.handleKeyDown}
Expand Down

0 comments on commit 9a31e89

Please sign in to comment.