Skip to content

Commit

Permalink
fix: add useScrollFreeze to Search header
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkmcadoo committed Oct 23, 2024
1 parent cddc074 commit e8e4a48
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/gatsby-theme-newrelic/src/components/GlobalSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useThrottle } from 'react-use';

import useKeyPress from '../hooks/useKeyPress';
import useThemeTranslation from '../hooks/useThemeTranslation';
import useScrollFreeze from '../hooks/useScrollFreeze';
import { addPageAction } from '../utils/nrBrowserAgent';

import useSearch from './SearchModal/useSearch';
Expand All @@ -31,6 +32,8 @@ const GlobalSearch = ({ onClose }) => {
const [selected, setSelected] = useState(null);
const possibleSelections = results.length + recentQueries.length;

useScrollFreeze(open);

const moveUp = () =>
setSelected((s) => {
if (s == null) return possibleSelections - 1;
Expand Down

0 comments on commit e8e4a48

Please sign in to comment.