Skip to content

Commit 42fe07e

Browse files
committed
fix(mobile): fill Android icon button touch targets
1 parent 2dd7a97 commit 42fe07e

1 file changed

Lines changed: 13 additions & 17 deletions

File tree

‎apps/mobile/src/components/MaterialIconButton.android.tsx‎

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {
2-
Box,
32
FilledIconButton,
43
FilledTonalIconButton,
54
Host,
@@ -22,8 +21,7 @@ export function MaterialIconButton(props: {
2221
readonly tintColorClassName?: string;
2322
}) {
2423
const { themeAppearance, themeVariables: colors } = useAppearancePreferences();
25-
const { scale, iconSize, buttonSize } = useAndroidControlSizing();
26-
const visualSize = Math.round(48 * scale);
24+
const { iconSize, buttonSize } = useAndroidControlSizing();
2725
const variant = props.variant ?? "standard";
2826
const Component =
2927
variant === "standard"
@@ -64,20 +62,18 @@ export function MaterialIconButton(props: {
6462
ignoreSafeAreaKeyboardInsets
6563
style={{ width: buttonSize, height: buttonSize }}
6664
>
67-
<Box modifiers={[size(buttonSize, buttonSize)]} contentAlignment="center">
68-
<Component
69-
onClick={props.onPress}
70-
enabled={!props.disabled}
71-
modifiers={[size(visualSize, visualSize)]}
72-
colors={
73-
variant === "standard"
74-
? undefined
75-
: { containerColor, disabledContainerColor: colors["--color-subtle-strong"] }
76-
}
77-
>
78-
{null}
79-
</Component>
80-
</Box>
65+
<Component
66+
onClick={props.onPress}
67+
enabled={!props.disabled}
68+
modifiers={[size(buttonSize, buttonSize)]}
69+
colors={
70+
variant === "standard"
71+
? undefined
72+
: { containerColor, disabledContainerColor: colors["--color-subtle-strong"] }
73+
}
74+
>
75+
{null}
76+
</Component>
8177
</Host>
8278
</View>
8379
{/* Keep RN SVG measurement outside Compose; the native button owns touch and ripple. */}

0 commit comments

Comments
 (0)