Skip to content

Commit

Permalink
Merge pull request #3350 from vojty/fix/validate-children-nav-keyboard
Browse files Browse the repository at this point in the history
Nav: Validate children in keyboard navigation handler
  • Loading branch information
taion committed Oct 25, 2018
2 parents 3360fde + 68909b3 commit 357d3b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ class Nav extends React.Component {

getNextActiveChild(offset) {
const { children } = this.props;
const validChildren = children.filter(
const validChildren = ValidComponentChildren.filter(
children,
child => child.props.eventKey != null && !child.props.disabled
);
const { activeKey, activeHref } = this.getActiveProps();
Expand Down
1 change: 1 addition & 0 deletions test/NavSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ describe('<Nav>', () => {
NavItem 4 content
</NavItem>
<NavItem eventKey={5}>NavItem 5 content</NavItem>
{false && <NavItem eventKey={6}>NavItem 6 content</NavItem>}
</Nav>,
{ attachTo: mountPoint }
);
Expand Down

0 comments on commit 357d3b7

Please sign in to comment.