From b1c1c49897fa291910a8dece9725190f21457132 Mon Sep 17 00:00:00 2001 From: dan Date: Sat, 23 Nov 2024 19:13:17 +0000 Subject: [PATCH] Fix avi button hitslops (#6662) * Remove web hack from non-web file * Remove hitSlop on the wrong Pressable It is not doing anything useful. * Extend avi column to prevent hit rect clipping You can't click outside the parent on Android. * Bump pressed opacity to .8 * Slightly reduce avi button hitslops * Asymmetric hit slop --- src/view/com/posts/AviFollowButton.tsx | 9 +++++++- src/view/com/posts/FeedItem.tsx | 2 +- src/view/com/util/forms/NativeDropdown.tsx | 24 +++++----------------- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/src/view/com/posts/AviFollowButton.tsx b/src/view/com/posts/AviFollowButton.tsx index 53e2146f458..1c894bffec4 100644 --- a/src/view/com/posts/AviFollowButton.tsx +++ b/src/view/com/posts/AviFollowButton.tsx @@ -95,7 +95,14 @@ export function AviFollowButton({ { const theme = useTheme() const defaultCtrlColor = theme.palette.default.postCtrl - const ref = React.useRef(null) - - // HACK - // fire a click event on the keyboard press to trigger the dropdown - // -prf - const onPress = isWeb - ? (evt: any) => { - if (evt instanceof KeyboardEvent) { - // @ts-ignore web only -prf - ref.current?.click() - } - } - : undefined return ( + // This Pressable doesn't actually do anything other than + // provide the "pressed state" visual feedback. [{opacity: pressed ? 0.5 : 1}]} - hitSlop={HITSLOP_10} - onPress={onPress}> + style={({pressed}) => [{opacity: pressed ? 0.8 : 1}]}> - + {props.children ? ( props.children ) : (