More info sheet: give each action button its own tap target
Directions and Report issue both fired on any tap inside their row: with the default button style a List row has a single row-wide tap target, so tapping one button triggered the other's action too (tapping Report issue opened Apple Maps, and tapping Directions showed the report alert). `.buttonStyle(.borderless)` gives each button its own hit area over its half-row frame. Verified with real simulated taps on both buttons.
This commit is contained in:
@@ -138,6 +138,12 @@ struct StationDetailView: View {
|
|||||||
.frame(maxWidth: .infinity)
|
.frame(maxWidth: .infinity)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// REQUIRED: with the default button style a `List` row has ONE
|
||||||
|
// row-wide tap target, so two buttons in the same row BOTH fire
|
||||||
|
// on any tap inside the row (tapping Directions also showed the
|
||||||
|
// report-issue alert and vice versa). `.borderless` gives each
|
||||||
|
// button its own hit area — the half-row frame above.
|
||||||
|
.buttonStyle(.borderless)
|
||||||
}
|
}
|
||||||
Section {
|
Section {
|
||||||
// The station name is NOT repeated here: the sheet header
|
// The station name is NOT repeated here: the sheet header
|
||||||
|
|||||||
Reference in New Issue
Block a user