-
-
Notifications
You must be signed in to change notification settings - Fork 148
Description
I use the action sheet for selecting an option from the list. I put Pressable component from react for each option, then when the user select the option, the onPress function is not firing at the first touch, but it works fine from the second touch. I don't know what am I doing wrong here.
Code:
<ActionSheet
id={id}
useBottomSafeAreaPadding
headerAlwaysVisible
gestureEnabled={false}
closeOnTouchBackdrop={true}
indicatorStyle={{
backgroundColor: "gray",
}}
containerStyle={{
backgroundColor: theme === "dark" ? "#111827" : "#ffffff",
paddingHorizontal: 16,
paddingTop: 8,
paddingBottom: 16,
}}
>
{options.map((option) => (
<Button
key={option.value?.toString()}
variant="ghost"
onPress={() => {
console.log("Button Pressed"); //this line does not work on the first touch. works on the second touch
onChange?.(option.value);
SheetManager.hide(id);
}}
className="my-1"
>
{option.label}
))}
{options.length === 0 && (
No options available
)}