Description
On Android, the title and message areas of the ActionSheet are tappable and trigger the callback function unexpectedly. This behavior differs from iOS where only the option buttons should be tappable.
Environment
Platform: Android
React Native: 0.76.9
@expo/react-native-action-sheet: ~4.1.0
Emulator: Pixel 9a (API 36.0)
Code example
const handlePress = () => {
showActionSheetWithOptions({
options: ['Option 1', 'Option 2', 'Cancel'],
cancelButtonIndex: 2,
title: 'This title is tappable on Android',
message: 'This message is also tappable on Android',
}, (selectedIndex) => {
console.log('Callback triggered with index:', selectedIndex);
// This gets called even when title/message is tapped
});
};