diff --git a/src/ui/city-autocomplete/CityAutocomplete.tsx b/src/ui/city-autocomplete/CityAutocomplete.tsx index 1e79066f..d47070a4 100644 --- a/src/ui/city-autocomplete/CityAutocomplete.tsx +++ b/src/ui/city-autocomplete/CityAutocomplete.tsx @@ -124,7 +124,16 @@ export const CityAutocomplete: FC = ({ } return null; })(); - const hasValue = Boolean(selectedCity); + // Mirror Angular's `[ngClass]="{ 'has-value': city }"` — any truthy + // model value (resolved city OR a free-typed string OR the raw code + // before dictionaries load) should reveal the clear button. Otherwise + // users can't wipe a partial input when the dictionary hasn't caught + // up yet. + const hasValue = Boolean( + selectedCity || + value || + (typeof inputValue === "string" ? inputValue : inputValue?.name), + ); return (