Skip to content

Commit

Permalink
Fix: persist sortOption in setter methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nekevss committed Apr 24, 2024
1 parent 57f2b86 commit 9b725e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/components/conformance/ResultsDisplay/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export default function ResultsDisplay(props: ResultsProps): JSX.Element {
props.state.version,
newPath,
props.state.ecmaScriptVersion,
props.state.sortOption,
),
});
};
Expand All @@ -105,6 +106,7 @@ export default function ResultsDisplay(props: ResultsProps): JSX.Element {
props.state.version,
slicedPath,
props.state.ecmaScriptVersion,
props.state.sortOption,
),
});
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/conformance/ResultsDisplay/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ type SortProps = {
};

function SortingDropdown(props: SortProps): JSX.Element {
const [sortValue, setSortValue] = React.useState<string | undefined>();
const [sortValue, setSortValue] = React.useState<string>(props.sortValue ? props.sortValue : "alpha");

React.useEffect(() => {
setSortValue(props.sortValue);
Expand Down

0 comments on commit 9b725e7

Please sign in to comment.