Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix focus issue in component filter #1828

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/components/ComponentOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const ComponentOverview = () => {
};

const category = useCurrentSidebarCategory();
const { location, push } = useHistory();
const { location, replace } = useHistory();

const params = new URLSearchParams(location.search);

Expand Down Expand Up @@ -105,7 +105,7 @@ export const ComponentOverview = () => {
params.append(SEARCH_PARAM, SEARCH_VALUES.ONLY_IMPLEMENTED);
}

push({ ...location, search: params.toString() });
replace({ ...location, search: params.toString() });
}, [showTodo, showHelpWanted, showCommunity, showCandidate, showHallOfFame, showOnlyImplemented]);

const todo = components.filter((c) => c.relayStep === 'UNKNOWN');
Expand All @@ -127,7 +127,7 @@ export const ComponentOverview = () => {
{
className: 'utrecht-accordion--nlds-subtle',
headingLevel: 2,
expanded: false,
expanded: params.size > 0,

// TODO: Make Pull Request for Utrecht Accordion to allow `ReactNode`
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
Loading