Skip to content

Commit

Permalink
set selected prop for selected tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavlo Aksonov committed Feb 23, 2016
1 parent 77b80d4 commit 8cae0ac
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
},
"dependencies": {
"react-native": "^0.20.0",
"react-native-tabs": "^1.0.1"
"react-native-tabs": "^1.0.2"
}
}
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Tabs extends Component {
style={[styles.iconView, this.props.iconStyle, el.props.name == this.props.selected ? this.props.selectedIconStyle || el.props.selectedIconStyle || {} : {} ]}
onPress={()=>!self.props.locked && self.onSelect(el)}
onLongPress={()=>self.props.locked && self.onSelect(el)}>
{self.props.selected == el.props.name ? React.cloneElement(el, {style: {...el.props.style, ...this.props.selectedStyle, ...el.props.selectedStyle}}) : el}
{self.props.selected == el.props.name ? React.cloneElement(el, {selected: true, style: {...el.props.style, ...this.props.selectedStyle, ...el.props.selectedStyle}}) : el}
</TouchableOpacity>
)}
</View>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-tabs",
"version": "1.0.1",
"version": "1.0.2",
"description": "React Native platform-independent tabs. Could be used for bottom tab bars as well as sectioned views (with tab buttons)",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 8cae0ac

Please sign in to comment.