feat: enhance SEO for listing and specialty pages, fix search autocomplete issue
This commit is contained in:
@@ -24,7 +24,9 @@ function AutoCompleteSearch({
|
||||
<Autocomplete
|
||||
freeSolo
|
||||
options={data}
|
||||
getOptionLabel={(option) => option.name}
|
||||
getOptionLabel={(option) =>
|
||||
typeof option === "string" ? option : (option?.name ?? "")
|
||||
}
|
||||
inputValue={inputValue}
|
||||
className="!w-full"
|
||||
onInputChange={(_, newInputValue) => {
|
||||
@@ -33,7 +35,10 @@ function AutoCompleteSearch({
|
||||
}}
|
||||
onChange={(_, newValue) => {
|
||||
setSelectedOption && setSelectedOption(newValue);
|
||||
handleSearch(newValue ? newValue.name : "");
|
||||
// freeSolo: مقدار تأییدشده میتواند رشتهٔ تایپشده باشد، نه گزینهٔ لیست.
|
||||
handleSearch(
|
||||
typeof newValue === "string" ? newValue : (newValue?.name ?? "")
|
||||
);
|
||||
}}
|
||||
componentsProps={clearIndicatorProps}
|
||||
renderOption={(props, option) => (
|
||||
|
||||
Reference in New Issue
Block a user