Skip to content

Commit

Permalink
SearchBox: Fix broken flyTo on mobile (#574)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dlurak authored Sep 20, 2024
1 parent e01f753 commit 860786b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/SearchBox/onHighlightFactory.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { AutocompleteHighlightChangeReason } from '@mui/material';
import { Feature } from '../../services/types';
import { GeocoderOption, Option } from './types';

Expand Down Expand Up @@ -31,7 +32,9 @@ export const getSkeleton = ({ geocoder }: GeocoderOption): Feature => {
};

export const onHighlightFactory =
(setPreview: (feature: unknown) => void) => (_: never, option: Option) => {
(setPreview: (feature: unknown) => void) =>
(_: never, option: Option, reason: AutocompleteHighlightChangeReason) => {
if (reason === 'touch') return;
if (!option) return;
if (option.type === 'star' && option.star.center) {
const { center } = option.star;
Expand Down

0 comments on commit 860786b

Please sign in to comment.