Browse Source

fix(birthplace): preserve separate country and city state and update detectedLocation

master
mortezaei 3 days ago
parent
commit
1ac830d12b
  1. 3
      src/components/Componentes/question-birthplace.tsx

3
src/components/Componentes/question-birthplace.tsx

@ -285,6 +285,7 @@ export function QuestionBirthplace({
if (resolvedC || updated.city) {
setDetectedLocation([updated.city, resolvedC].filter(Boolean).join(", "));
}
lastInternalAnswerRef.current = typeof rawValue === "string" ? rawValue : null;
}, [rawValue, locale]);
const options = getCountryList(locale);
@ -299,6 +300,7 @@ export function QuestionBirthplace({
setSelectedCountry(country);
closeSheet();
updateAnswers(country, cityInput);
setDetectedLocation([cityInput, country].filter(Boolean).join(", "));
window.setTimeout(() => {
cityInputRef.current?.focus({ preventScroll: true });
}, EXIT_ANIMATION_MS);
@ -311,6 +313,7 @@ export function QuestionBirthplace({
const newCity = e.target.value;
setCityInput(newCity);
updateAnswers(selectedCountry, newCity);
setDetectedLocation([newCity, selectedCountry].filter(Boolean).join(", "));
};
const isRtl = locale === "fa" || locale === "ar" || locale === "ur";

Loading…
Cancel
Save