Skip to content

Commit 5026fb8

Browse files
chrisbobbegnprice
authored andcommitted
ComposeMenu: Remove a negative margin; don't make touch targets overlap
With padding 12 (and no negative margin), each button's touch target is 12 + 24 + 12 = 48, and they don't overlap with each other. (The 24 is the icon's width.) We try to keep touch targets 48px minimum so they're not too hard to hit. This makes them take up a bit more horizontal space, but that's OK here -- it doesn't shrink the message text input down to zero width, on my iPhone, and also we're about to move these buttons into a row below the message text input.
1 parent 8b4f0d7 commit 5026fb8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compose/ComposeMenu.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ type MenuButtonProps = $ReadOnly<{|
8282

8383
function MenuButton(props: MenuButtonProps) {
8484
const { onPress, IconComponent } = props;
85-
const style = useMemo(() => ({ padding: 12, marginRight: -8 }), []);
85+
const style = useMemo(() => ({ padding: 12 }), []);
8686

8787
return (
8888
<Pressable style={style} onPress={onPress}>
@@ -252,7 +252,7 @@ export default function ComposeMenu(props: Props): Node {
252252
<View style={styles.container}>
253253
<AnimatedComponent
254254
stylePropertyName="width"
255-
fullValue={40 * numIcons}
255+
fullValue={48 * numIcons}
256256
useNativeDriver={false}
257257
visible={expanded}
258258
>

0 commit comments

Comments
 (0)