Skip to content

Commit cd6e711

Browse files
committed
refine for setting attributes on editor
1 parent e02f20c commit cd6e711

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/TableEditColumn.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,25 +161,24 @@ class TableEditColumn extends Component {
161161

162162
getInputRef = userRef => ref => {
163163
this.inputRef = ref;
164-
if (typeof userRef === 'string') {
165-
throw new Error('Ref must be a function');
166-
}
167164
if (Util.isFunction(userRef)) {
168165
userRef(ref);
166+
} else if (typeof userRef === 'string') {
167+
throw new Error('Ref must be a function');
169168
}
170169
}
171170

172-
getHandleKeyPress = userHandler => e => {
171+
getHandleKeyPress = customHandler => e => {
173172
this.handleKeyPress(e);
174-
if (Util.isFunction(userHandler)) {
175-
userHandler(e);
173+
if (Util.isFunction(customHandler)) {
174+
customHandler(e);
176175
}
177176
}
178177

179-
getHandleBlur = userHandler => e => {
178+
getHandleBlur = customHandler => e => {
180179
this.handleBlur(e);
181-
if (Util.isFunction(userHandler)) {
182-
userHandler(e);
180+
if (Util.isFunction(customHandler)) {
181+
customHandler(e);
183182
}
184183
}
185184

@@ -202,7 +201,7 @@ class TableEditColumn extends Component {
202201
let style = { position: 'relative' };
203202
let { fieldValue } = this.props;
204203
let { className } = this.state;
205-
// put placeholder if exist
204+
206205
if (editable.placeholder) {
207206
attr.placeholder = editable.placeholder;
208207
/* eslint-disable no-console */

0 commit comments

Comments
 (0)