From 2ce08fa28373b9940dea0cfb78bd770283b9d953 Mon Sep 17 00:00:00 2001 From: Walter Buczacka Date: Fri, 26 Apr 2024 13:27:11 -0300 Subject: [PATCH] simplify & focus with current FocusTrap mantine component --- packages/next/cms/components/fields/ProfileSearch.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/next/cms/components/fields/ProfileSearch.js b/packages/next/cms/components/fields/ProfileSearch.js index b14ea8b78..6169d74ec 100644 --- a/packages/next/cms/components/fields/ProfileSearch.js +++ b/packages/next/cms/components/fields/ProfileSearch.js @@ -26,7 +26,6 @@ import ProfileTile from "./ProfileTile"; import groupMeta from "../../utils/groupMeta"; import stripHTML from "../../utils/formatters/stripHTML"; import NonIdealState from "../../../core/components/NonIdealState"; -import {useFocus} from "../../hooks/useFocus"; function DimensionFilters({ activeProfile, @@ -277,10 +276,6 @@ export function ProfileSearch({ const [debouncedQuery] = useDebouncedValue(query, 400); const profiles = useCMSProfiles(); - const [inputRef, setInputFocus] = useFocus(); - - React.useLayoutEffect(() => setInputFocus(), [setInputFocus]); - const ignoredTermsRegex = ignoredTerms && ignoredTerms.length > 0 ? new RegExp(`\\b(${ignoredTerms.join("|")})\\b`, "ig") : false; @@ -412,14 +407,13 @@ export function ProfileSearch({ } size="xl" placeholder={placeholder} onFocus={() => setActive(true)} onChange={(event) => setQuery(event.target.value)} - autoFocus + data-autofocus {...inputProps} />