From 1ac830d12b34509625091b9a6a0fa1d530a995ca Mon Sep 17 00:00:00 2001 From: mortezaei Date: Fri, 21 Aug 2026 20:46:07 +0330 Subject: [PATCH] fix(birthplace): preserve separate country and city state and update detectedLocation --- src/components/Componentes/question-birthplace.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/Componentes/question-birthplace.tsx b/src/components/Componentes/question-birthplace.tsx index bc10c05..ea99112 100644 --- a/src/components/Componentes/question-birthplace.tsx +++ b/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";