Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions js/SegmentedControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const SegmentedControl = ({
layout: {width},
},
}) => {
const newSegmentWidth = values.length ? width / values.length : 0;
const newSegmentWidth = values.length ? (width - 4) / values.length : 0;
if (newSegmentWidth !== segmentWidth) {
animation.setValue(newSegmentWidth * (selectedIndex || 0));
setSegmentWidth(newSegmentWidth);
Expand Down Expand Up @@ -121,10 +121,10 @@ const styles = StyleSheet.create({
slider: {
position: 'absolute',
borderRadius: 5,
top: 1,
bottom: 1,
right: 1,
left: 1,
top: 2,
bottom: 2,
right: 2,
left: 2,
},
});

Expand Down
3 changes: 3 additions & 0 deletions js/SegmentedControlTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ export const SegmentedControlTab = ({
<TouchableOpacity
style={styles.container}
disabled={!enabled}
activeOpacity={0.5}
delayPressIn={0}
delayPressOut={0}
onPress={onSelect}>
<View style={[styles.default]}>
{typeof value === 'number' || typeof value === 'object' ? (
Expand Down