MCPcopy
hub / github.com/nadbm/react-datasheet / handleCommit

Function handleCommit

src/DataCell.js:83–95  ·  view source on GitHub ↗
(value, e)

Source from the content-addressed store, hash-verified

81 }
82
83 handleCommit (value, e) {
84 const { onChange, onNavigate } = this.props
85 if (value !== initialData(this.props)) {
86 this.setState({ value, committing: true })
87 onChange(this.props.row, this.props.col, value)
88 } else {
89 this.handleRevert()
90 }
91 if (e) {
92 e.preventDefault()
93 onNavigate(e, true)
94 }
95 }
96
97 handleRevert () {
98 this.setState({ reverting: true })

Callers

nothing calls this directly

Calls 2

onChangeFunction · 0.85
initialDataFunction · 0.70

Tested by

no test coverage detected