Skip to content

Commit

Permalink
Merge pull request #1390 from Datawheel/wb/1309_fe_and_css_issues_update
Browse files Browse the repository at this point in the history
simplify & focus with current FocusTrap mantine component
  • Loading branch information
davelandry authored Apr 26, 2024
2 parents 2a7fb28 + 2ce08fa commit f51ad25
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 f51ad25

Please sign in to comment.