Skip to content

Commit

Permalink
Merge pull request #15 from bamlab/taboulot-patch-1
Browse files Browse the repository at this point in the history
fix(getInputs): Fix getInputs for <Text> children
  • Loading branch information
taboulot authored Apr 11, 2018
2 parents 6867b3e + a0dd9d4 commit a22c534
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/withNextInputAutoFocus.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ const withNextInputAutoFocusContextType = {

getInputs = children =>
(isArray(children) ? children : [children]).reduce((partialInputs, child) => {
if (child.props.children) {
if (child.props && child.props.children) {
return partialInputs.concat(getInputs(child.props.children));
}
if (child && !!child.props.name) return partialInputs.concat(child);
if (child && child.props && !!child.props.name) return partialInputs.concat(child);
return partialInputs;
}, []);

Expand Down

0 comments on commit a22c534

Please sign in to comment.