Skip to content

Commit 9a31e89

Browse files
fix(EditableCell): Change behavior to save cell contents when losing focus, clicking away etc.
fix #562
1 parent 017a634 commit 9a31e89

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/editor/components/timetable/EditableCell.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,10 @@ export default class EditableCell extends Component<Props, State> {
259259
}
260260
}
261261

262+
handleBlur = () => {
263+
this.save()
264+
}
265+
262266
handleChange = (evt: SyntheticInputEvent<HTMLInputElement>) => {
263267
this.setState({data: evt.target.value})
264268
}
@@ -335,7 +339,7 @@ export default class EditableCell extends Component<Props, State> {
335339
autoFocus
336340
defaultValue={renderCell(column, data)}
337341
className='cell-input'
338-
onBlur={this.cancel}
342+
onBlur={this.handleBlur}
339343
onChange={this.handleChange}
340344
onFocus={this._onInputFocus}
341345
onKeyDown={this.handleKeyDown}

0 commit comments

Comments
 (0)