diff --git a/src/features/flights-map/components/FlightsMapFilter.tsx b/src/features/flights-map/components/FlightsMapFilter.tsx index a835917d..92012117 100644 --- a/src/features/flights-map/components/FlightsMapFilter.tsx +++ b/src/features/flights-map/components/FlightsMapFilter.tsx @@ -152,11 +152,23 @@ export const FlightsMapFilter: FC = ({ placeholder={t("FLIGHTS-MAP.FILTER_DEPARTURE_PLACEHOLDER")} value={value.departure ?? ""} onChange={(code) => { - onChange({ - ...value, - departure: code || undefined, - arrival: undefined, - }); + // Mirrors Angular FlightsMapFiltersStateService.setDeparture: + // clearing departure also resets the three toggles (domestic, + // international, connections) back to false since none of them + // apply without a departure anchor. Keeping them on would leave + // the disabled chip in an "on" visual state after re-opening. + if (!code) { + onChange({ + ...value, + departure: undefined, + arrival: undefined, + domestic: false, + international: false, + connections: false, + }); + return; + } + onChange({ ...value, departure: code, arrival: undefined }); }} dictionaries={dictionaries} onLocate={handleLocate} @@ -207,8 +219,15 @@ export const FlightsMapFilter: FC = ({
+ {/* Mirrors Angular: domestic/international toggles require a + departure city; the connections toggle also requires an + arrival city (you can only route-search with both cities). + We add `title` hints so disabled toggles explain why they + can't be toggled — Angular's toggle-switch doesn't surface + this, but the hint is a pure UX win at no parity cost. */}