Skip to content

Commit

Permalink
fix: clear input after selecting a result in stream/lake filter
Browse files Browse the repository at this point in the history
  • Loading branch information
stdavis committed Nov 18, 2024
1 parent d7e0a83 commit fa2087d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/filters/Location.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Graphic from '@arcgis/core/Graphic';
import {
AsyncListItem,
Button,
featureServiceProvider,
multiProvider,
Expand All @@ -9,7 +10,7 @@ import {
useFirebaseAuth,
} from '@ugrc/utah-design-system';
import { useEffect } from 'react';
import { useListData } from 'react-stately';
import { AsyncListData, useListData } from 'react-stately';
import config from '../../config';
import { useFilter } from '../contexts/FilterProvider';

Expand Down Expand Up @@ -50,7 +51,10 @@ export default function Location(): JSX.Element {
});
const { filterDispatch } = useFilter();

const onSherlockMatch = (matches: Graphic[]) => {
const onSherlockMatch = (matches: Graphic[], context: { list: AsyncListData<AsyncListItem> }) => {
// clear contents of input
context.list.setFilterText('');

list.append(...matches);
};

Expand Down

0 comments on commit fa2087d

Please sign in to comment.