Skip to content

Commit 1043b31

Browse files
author
Zach Silveira
authored
Missed adding an index
1 parent bf8751d commit 1043b31

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

form.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ export default class Form extends React.Component {
1515
children: this.renderChildren(child.props.children, index)
1616
});
1717
if (child.type.name !== 'TextInput') return child;
18-
18+
19+
let realIndex = index + recursiveIndex
1920
return React.cloneElement(child, {
2021
onEnter: () =>
21-
this.inputs[index + recursiveIndex + 1] ? this.inputs[index + recursiveIndex + 1].focus() : null,
22-
inputRef: ref => (this.inputs[index] = ref),
22+
this.inputs[realIndex + 1] ? this.inputs[realIndex + 1].focus() : null,
23+
inputRef: ref => (this.inputs[realIndex] = ref),
2324
});
2425
});
2526
}

0 commit comments

Comments
 (0)