expo / react-native-action-sheet

A cross-platform ActionSheet for React Native
MIT License
1.37k stars 224 forks source link

[Android] Action sheet text gets cut-off #298

Open bradzickafoose opened 1 year ago

bradzickafoose commented 1 year ago

Action sheet text gets cut-off on Android devices and can be replicated in the example project.

You can see the issue here: Screenshot_20230327-103506 (Screenshot is from a Google Pixel 4a, Android 13)

Until a better solution exists, one hacky solution is to add a space to the end of the text.

LegendEffects commented 1 year ago

Bump, had a similar issue reported from a Samsung A22 running Android 13 where the "l" from cancel is cut off.

StuartCallan commented 1 year ago

I also had this issue reported by a user. After doing some digging, I found that the trigger to reproduce this is to set "Bold text" option to true in "Display size and text" in Accessibility settings.

Can also confirm that @bradzickafoose workaround to add a space to the end of the option text works.

bradbyte commented 1 year ago

@StuartCallan thanks for the update! For a real fix, perhaps we need to add some padding to the container? Has anyone replicated it running the action sheet locally and able to fix without adding the space? Thanks!

wcgray commented 11 months ago

For me, this worked as a workaround:

showActionSheetWithOptions({
    options: options,
    cancelButtonIndex: options.length - 1,
    textStyle: Platform.OS === 'android' ? {  
        minWidth: Dimensions.get('window').width * 0.9,
    } : undefined,
}, (selectedIndex: number) => {
    // do something...
});
oskaremilsson commented 1 week ago

One year later and I still need to use a work around? Have someone found something that can be fixed in the package?