Skip to content

Commit 5c80683

Browse files
committed
Border radius are customizable now for animation
1 parent 17ab9cd commit 5c80683

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

lib/RNSingleSelect.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ interface IProps {
4646
ImageComponent?: any;
4747
disableAbsolute?: boolean;
4848
placeholderTextStyle?: any;
49+
animatedBorderRadius?: number;
4950
placeholderTextColor?: string;
5051
arrowImageStyle?: ImageStyle;
5152
menuItemTextStyle?: TextStyle;
@@ -70,6 +71,7 @@ const RNSingleSelect = (props: IProps) => {
7071
placeholder,
7172
onTextChange,
7273
arrowImageStyle,
74+
animatedBorderRadius,
7375
placeholderTextColor,
7476
buttonContainerStyle,
7577
placeholderTextStyle,
@@ -95,7 +97,7 @@ const RNSingleSelect = (props: IProps) => {
9597
>(data);
9698
const [borderRadiusAnimation, setBorderRadiusAnimation] = React.useState<
9799
Animated.Value
98-
>(new Animated.Value(16));
100+
>(new Animated.Value(animatedBorderRadius || 16));
99101
const [
100102
menuBarYTranslateAnimation,
101103
setMenuBarYTranslateAnimation,
@@ -109,7 +111,7 @@ const RNSingleSelect = (props: IProps) => {
109111

110112
const animateBorderRadius = () => {
111113
Animated.timing(borderRadiusAnimation, {
112-
toValue: menuToggled ? 16 : 0,
114+
toValue: menuToggled ? animatedBorderRadius || 16 : 0,
113115
duration: 1250,
114116
easing: Easing.bounce,
115117
useNativeDriver: true,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@freakycoder/react-native-single-select",
3-
"version": "0.2.18",
3+
"version": "0.2.19",
44
"description": "Customizable & Easy to Use Single Select Library for React Native",
55
"main": "./build/dist/RNSingleSelect.js",
66
"repository": "git@github.com:WrathChaos/react-native-single-select.git",

0 commit comments

Comments
 (0)