From 7fcc73fd13b55d224e74b97d97d298456ee02ab7 Mon Sep 17 00:00:00 2001 From: Ivan Wu Date: Fri, 10 Mar 2017 08:46:27 -0800 Subject: [PATCH] Ignore onSelect if selected tab is same and this tab --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index f39859f..23b1fe5 100644 --- a/index.js +++ b/index.js @@ -21,6 +21,9 @@ class Tabs extends Component { state: State = {}; onSelect(el){ + if (el.props.name === this.props.selected) { + // do nothing since still on the same tab + } if (el.props.onSelect) { el.props.onSelect(el); } else if (this.props.onSelect) {