Skip to content

Commit

Permalink
Small changes (#87)
Browse files Browse the repository at this point in the history
update searchbar to ensure execute right universal/vertical execution

J=none
TEST=manual

see that vertical search page now updates result correctly
  • Loading branch information
yen-tt committed Dec 9, 2021
1 parent 98cc2c8 commit c7328bb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sample-app/src/components/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function SearchBar({
? answersActions.executeVerticalAutocomplete()
: answersActions.executeUniversalAutocomplete();
});
const [executeQuery, autocompletePromiseRef] = useSearchWithNearMeHandling(answersActions, geolocationOptions);
const [executeQuery, autocompletePromiseRef] = useSearchWithNearMeHandling(answersActions, isVertical, geolocationOptions);

const options = autocompleteResponse?.results.map(result => {
return {
Expand Down
2 changes: 1 addition & 1 deletion sample-app/src/hooks/useSearchWithNearMeHandling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ type AutocompleteRef = MutableRefObject<Promise<AutocompleteResponse | undefined
*/
export default function useSearchWithNearMeHandling(
answersActions: AnswersHeadless,
isVertical: boolean = false,
geolocationOptions?: PositionOptions,
isVertical = false
): [QueryFunc, AutocompleteRef] {
/**
* Allow a query search to wait on the response to the autocomplete request right
Expand Down
2 changes: 1 addition & 1 deletion sample-app/src/pages/StandardLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const StandardLayout: LayoutComponent = ({ page }) => {
{isVertical
? <SearchBar
placeholder='Search...'
isVertical={true}
isVertical={isVertical}
screenReaderInstructionsId='SearchBar__srInstructions'
/>
: <SampleVisualSearchBar />
Expand Down

0 comments on commit c7328bb

Please sign in to comment.