From 68909b3a6435cc16abffd2d3a63cea40e121571f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Vojt=C3=A1=C5=A1ek?= Date: Thu, 25 Oct 2018 12:40:24 +0200 Subject: [PATCH] Nav: Validate children in keyboard navigation handler --- src/Nav.js | 3 ++- test/NavSpec.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Nav.js b/src/Nav.js index 8f46a91dd2..9aa6123e63 100644 --- a/src/Nav.js +++ b/src/Nav.js @@ -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(); diff --git a/test/NavSpec.js b/test/NavSpec.js index 46a192df2c..341655a50b 100644 --- a/test/NavSpec.js +++ b/test/NavSpec.js @@ -168,6 +168,7 @@ describe(', { attachTo: mountPoint } );