From d766113f69a9a783f8c2eca3d5a77ff813ee63a6 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Tue, 18 Apr 2023 11:19:20 +0200 Subject: [PATCH] :sparkles: Fixing select --- .../Components/DesignSystem/Select/index.tsx | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/front/Components/DesignSystem/Select/index.tsx b/src/front/Components/DesignSystem/Select/index.tsx index 3c0453c7..9a389c2d 100644 --- a/src/front/Components/DesignSystem/Select/index.tsx +++ b/src/front/Components/DesignSystem/Select/index.tsx @@ -26,6 +26,7 @@ type IState = { isOpen: boolean; listWidth: number; listHeight: number; + selectedOption: IOption | null; }; export default class Select extends React.Component { @@ -39,13 +40,14 @@ export default class Select extends React.Component { isOpen: false, listHeight: 0, listWidth: 0, + selectedOption: null, }; this.toggle = this.toggle.bind(this); this.onSelect = this.onSelect.bind(this); } public override render(): JSX.Element { - const selectedOption = this.props.selectedOption; + const selectedOption = this.state.selectedOption ?? this.props.selectedOption; return (