From db3c9d660e19d016b599742ecdee14aa93f7bfbc Mon Sep 17 00:00:00 2001 From: EvKoh <1309463+EvKoh@users.noreply.github.com> Date: Sat, 3 Oct 2026 15:51:34 +0200 Subject: [PATCH] fix(mobile): announce which Show and rating chip is chosen MChip only showed its state through colour. A pressable option renders aria-pressed from active; the places filter's Show and rating floor chips use it, and the tests now check the chosen chip by its pressed state. --- client/src/mobile/components/MChip.tsx | 9 ++++++++- .../screens/trip/places/MPlacesFilterControls.tsx | 2 +- .../screens/trip/places/MPlacesFilterSheet.tsx | 2 +- .../tests/unit/mobile/trip/MPlacesBrowser.test.tsx | 1 + .../unit/mobile/trip/MPlacesFilterSheet.test.tsx | 12 ++++++++++-- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/client/src/mobile/components/MChip.tsx b/client/src/mobile/components/MChip.tsx index 414a61e91..5669ad7cd 100644 --- a/client/src/mobile/components/MChip.tsx +++ b/client/src/mobile/components/MChip.tsx @@ -10,16 +10,23 @@ interface MChipProps { * back what it can: the chips that start a search are the ones worth the height. */ size?: 'sm' | 'tap' + /** + * The chip is one choice of a picker: announce `active` as `aria-pressed`, so a + * screen reader hears which one is on, not just its colour. Off by default, for + * chips that only run an action. + */ + pressable?: boolean className?: string children: ReactNode } /** Small pill chip: --m-act when active, neutral --m-ic surface otherwise. */ -export default function MChip({ active = false, onClick, size = 'sm', className = '', children }: MChipProps) { +export default function MChip({ active = false, onClick, size = 'sm', pressable = false, className = '', children }: MChipProps) { return (