Skip to content

Commit

Permalink
simplify & focus with current FocusTrap mantine component
Browse files Browse the repository at this point in the history
  • Loading branch information
Walter Buczacka authored and Walter Buczacka committed Apr 26, 2024
1 parent 41b7ca8 commit 2ce08fa
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/next/cms/components/fields/ProfileSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -412,14 +407,13 @@ export function ProfileSearch({
</Text>
</Text>
<TextInput
ref={inputRef}
className="cp-input"
icon={<IconSearch />}
size="xl"
placeholder={placeholder}
onFocus={() => setActive(true)}
onChange={(event) => setQuery(event.target.value)}
autoFocus
data-autofocus
{...inputProps}
/>
<ProfileFilters
Expand Down

0 comments on commit 2ce08fa

Please sign in to comment.