diff --git a/apps/business/src/components/CitySearchSelect.module.css b/apps/business/src/components/CitySearchSelect.module.css index bf18b57..a3f02cc 100644 --- a/apps/business/src/components/CitySearchSelect.module.css +++ b/apps/business/src/components/CitySearchSelect.module.css @@ -81,10 +81,12 @@ } .dropdown { - position: static; - margin-top: 6px; - max-height: none; - overflow: visible; + position: absolute; + top: calc(100% + 6px); + inset-inline: 0; + z-index: 120; + max-height: min(280px, 50vh); + overflow-y: auto; background: var(--elevated-surface); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); diff --git a/apps/business/src/components/CitySearchSelect.tsx b/apps/business/src/components/CitySearchSelect.tsx index eccaeb6..6340b29 100644 --- a/apps/business/src/components/CitySearchSelect.tsx +++ b/apps/business/src/components/CitySearchSelect.tsx @@ -14,6 +14,8 @@ interface CitySearchSelectProps { onChange: (value: string) => void disabled?: boolean placeholder?: string + noResultsLabel?: string + clearLabel?: string id?: string } @@ -23,6 +25,8 @@ export function CitySearchSelect({ onChange, disabled = false, placeholder, + noResultsLabel, + clearLabel, id, }: CitySearchSelectProps) { const t = useT() @@ -34,6 +38,8 @@ export function CitySearchSelect({ const selected = options.find((option) => option.id === value) const selectedLabel = selected ? getLocationOptionLabel(selected, locale) : '' const searchPlaceholder = placeholder ?? t('customerProducts.form.fields.searchCity') + const emptyLabel = noResultsLabel ?? t('customerProducts.form.fields.noCities') + const clearAriaLabel = clearLabel ?? t('customerProducts.form.fields.clearCity') const filtered = options.filter((option) => { const q = query.trim().toLowerCase() @@ -108,7 +114,7 @@ export function CitySearchSelect({ type="button" className={styles.clearBtn} onClick={() => onChange('')} - aria-label={t('customerProducts.form.fields.clearCity')} + aria-label={clearAriaLabel} > @@ -123,7 +129,7 @@ export function CitySearchSelect({ {open && !disabled ? (