From 485e1c44975a18315468f7a73e6e75221457a4f6 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 26 Apr 2021 14:57:04 -0700 Subject: [PATCH] IO-934 Refactor some search select fields & save employee on new ticket --- .../employee-search-select.component.jsx | 20 +++----------- .../job-search-select.component.jsx | 27 +++++-------------- .../time-ticket-modal.container.jsx | 8 +++++- 3 files changed, 17 insertions(+), 38 deletions(-) diff --git a/client/src/components/employee-search-select/employee-search-select.component.jsx b/client/src/components/employee-search-select/employee-search-select.component.jsx index 6785ee48a..85dcc05e4 100644 --- a/client/src/components/employee-search-select/employee-search-select.component.jsx +++ b/client/src/components/employee-search-select/employee-search-select.component.jsx @@ -1,33 +1,21 @@ import { Select, Space, Tag } from "antd"; -import React, { forwardRef, useEffect, useState } from "react"; +import React, { forwardRef } from "react"; import { useTranslation } from "react-i18next"; const { Option } = Select; //To be used as a form element only. -const EmployeeSearchSelect = ( - { value, onChange, options, onSelect, onBlur, ...restProps }, - ref -) => { - const [option, setOption] = useState(value); +const EmployeeSearchSelect = ({ options, ...props }, ref) => { const { t } = useTranslation(); - useEffect(() => { - if (value !== option && onChange) { - onChange(option); - } - }, [value, option, onChange]); return (