summaryrefslogtreecommitdiffstats
path: root/ui/src/components/sort-select.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/components/sort-select.tsx')
-rw-r--r--ui/src/components/sort-select.tsx10
1 files changed, 7 insertions, 3 deletions
diff --git a/ui/src/components/sort-select.tsx b/ui/src/components/sort-select.tsx
index 05abdb20..33d65819 100644
--- a/ui/src/components/sort-select.tsx
+++ b/ui/src/components/sort-select.tsx
@@ -23,6 +23,12 @@ export class SortSelect extends Component<SortSelectProps, SortSelectState> {
this.state = this.emptyState;
}
+ static getDerivedStateFromProps(props: any): SortSelectState {
+ return {
+ sort: props.sort,
+ };
+ }
+
render() {
return (
<>
@@ -59,8 +65,6 @@ export class SortSelect extends Component<SortSelectProps, SortSelectState> {
}
handleSortChange(i: SortSelect, event: any) {
- i.state.sort = Number(event.target.value);
- i.setState(i.state);
- i.props.onChange(i.state.sort);
+ i.props.onChange(event.target.value);
}
}