[Also submitted as FB20213961]
SwiftUI Button
with a label:
closure containing only an Image
view has a smaller tap target than buttons created with a Label
or the convenience initializer. The hit area shrinks to the image bounds instead of preserving the standard minimum tappable size.
SCREEN RECORDING
On a physical device, the difference is obvious—it’s easy to miss the button. Sometimes it even shows the button-tapped bounce animation but doesn’t trigger the action.
SYSTEM INFO
- Xcode Version 26.0 (17A321)
- macOS 15.6.1 (24G90)
- iOS 26.0 (23A340)
SAMPLE CODE
The following snippet shows the difference in hit targets between the convenience initializer, a Label
, and an Image
(the latter two in a label:
closure).
// ✅ Hit target is entire button
Button("Button 1", systemImage: "1.square.fill") {
print("Button 1 tapped")
}
// ✅ Hit target is entire button
Button {
print("Button 2 tapped")
} label: {
Label("Button 2", systemImage: "2.square.fill")
}
// ❌ Hit target is smaller than button
Button {
print("Button 3 tapped")
} label: {
Image(systemName: "3.square.fill")
}