Skip to content

Commit

Permalink
fix: 缩小picker的scale,并配置文字的超出效果
Browse files Browse the repository at this point in the history
  • Loading branch information
chj-damon committed Apr 18, 2024
1 parent b1257f7 commit 57f5fb6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/lemon-tomatoes-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@td-design/react-native-picker': patch
---

fix: 缩小picker的scale,并配置文字的超出效果
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function WheelPickerItem({ textStyle, style, visibleRest, height, option, index,
opacityOutputRange.push(y);
}

const scaleOutputRange = [1.3];
const scaleOutputRange = [1.1];
for (let x = 1; x <= visibleRest + 1; x++) {
const y = scaleFunction(x);
scaleOutputRange.unshift(y);
Expand Down Expand Up @@ -52,7 +52,9 @@ function WheelPickerItem({ textStyle, style, visibleRest, height, option, index,

return (
<Animated.View style={[styles.option, style, { opacity, transform: [{ rotateX }, { scale }] }]}>
<Animated.Text style={textStyle}>{option?.label}</Animated.Text>
<Animated.Text style={textStyle} numberOfLines={1} ellipsizeMode={'tail'}>
{option?.label}
</Animated.Text>
</Animated.View>
);
}
Expand Down

0 comments on commit 57f5fb6

Please sign in to comment.