Merged in fix/SW-2451-destinations-mobile-search (pull request #1995)

fix: SW-2451 Fix Search field hidden behind list

* fix: SW-2451 Fix Search field hidden behind list

(cherry picked from commit 4e8f02ffd7dc94ec0469fc8c572aab39542d459e)

* fix: SW-2451 Optimized code

* fix: SW-2451 Added forced focus & optimised code

* Fix: SW-2451 Optimised code

* fix: SW-2451 Removed untranslated error message

* fix: SW-2451 Optimised code


Approved-by: Erik Tiekstra
This commit is contained in:
Hrishikesh Vaipurkar
2025-05-13 07:00:32 +00:00
parent 45f61bd81e
commit 5a351991e1
7 changed files with 197 additions and 31 deletions

View File

@@ -21,6 +21,8 @@ import SearchList from "./SearchList"
import styles from "./search.module.css"
interface SearchProps {
autoFocus?: boolean
alwaysShowResults?: boolean
className?: string
handlePressEnter: () => void
inputName: string
@@ -32,6 +34,8 @@ interface SearchProps {
}
export function Search({
autoFocus,
alwaysShowResults,
handlePressEnter,
inputName: SEARCH_TERM_NAME,
onSelect,
@@ -97,6 +101,7 @@ export function Search({
itemToString={(value) => (value ? value.name : "")}
onSelect={handleOnSelect}
defaultHighlightedIndex={0}
isOpen={alwaysShowResults}
>
{({
getInputProps,
@@ -149,6 +154,7 @@ export function Search({
},
type: "search",
})}
autoFocus={autoFocus}
/>
</div>
</div>