Skip to content

Commit

Permalink
fix(VoiceControl): accessibilityInputLabel for sheet nav links (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
KaylaBrady authored Nov 3, 2024
1 parent d07e71c commit 1d96d3e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
1 change: 0 additions & 1 deletion iosApp/iosApp/ComponentViews/DirectionRowView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ struct DirectionRowView: View {
DirectionLabel(direction: direction)
.foregroundStyle(Color.text)
}
.accessibilityInputLabels([direction.destination ?? direction.name])
}
}

Expand Down
1 change: 0 additions & 1 deletion iosApp/iosApp/ComponentViews/HeadsignRowView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ struct HeadsignRowView: View {
.font(Typography.bodySemibold)
.multilineTextAlignment(.leading)
}
.accessibilityInputLabels([headsign])
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ struct StopDeparturesSummaryList: View {
Array(patternsByStop.patterns.enumerated()),
id: \.element.id
) { index, patterns in

let inputLabel = switch onEnum(of: patterns) {
case let .byHeadsign(byHeadsign): byHeadsign.headsign
case let .byDirection(byDirection): byDirection.direction.destination ?? byDirection.direction.name
}

VStack(spacing: 0) {
SheetNavigationLink(
value: .stopDetails(
Expand All @@ -36,6 +42,7 @@ struct StopDeparturesSummaryList: View {
condenseHeadsignPredictions: condenseHeadsignPredictions
)
}
.accessibilityInputLabels([inputLabel])
.padding(8)
.frame(minHeight: 44)
.padding(.leading, 8)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ struct StopDetailsFilteredRouteView: View {
.onRow(route: row.route) : .none
)
}
.accessibilityInputLabels([row.headsign])
.padding(.vertical, 10)
.padding(.horizontal, 16)

Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosApp/Pages/TripDetails/TripDetailsStopView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct TripDetailsStopView: View {
.accessibilityAddTraits(.isHeader)
.accessibilityHeading(.h2)
}
)
).accessibilityInputLabels([stop.stop.name])
if !stop.routes.isEmpty {
scrollRoutes
.accessibilityElement()
Expand Down

0 comments on commit 1d96d3e

Please sign in to comment.