Skip to content

Commit

Permalink
fixed autocomplete text field undefined bug
Browse files Browse the repository at this point in the history
  • Loading branch information
TharindaPrabhath committed Oct 3, 2021
1 parent 890aca2 commit 357fb62
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/screens/NewCertificate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import CertifyCheckbox from "../components/core/CertifyCheckbox";
import { Autocomplete } from "@material-ui/lab";
import useLocalStorage from "../utils/useLocalStorage";

const sleep = (time: number) => new Promise((acc) => setTimeout(acc, time));
//const sleep = (time: number) => new Promise((acc) => setTimeout(acc, time));

const NewCertificate = () => {
const [memberCertificate, setMemberCertificate] = useState(true);
Expand All @@ -53,7 +53,6 @@ const NewCertificate = () => {
// based on auto complete trash
const [reciever, setReciever] = useState("");
const [recieverId, setRecieverId] = useState(0);
const [value, setValue] = useState<string>("");
const [inputValue, setInputValue] = useState("");
//--------------------------------------------------

Expand Down Expand Up @@ -346,7 +345,9 @@ const NewCertificate = () => {
}}
options={suggestions}
getOptionLabel={(option) =>
option.fname + " " + option.lname
option.fname === undefined && option.lname === undefined
? ""
: option.fname + " " + option.lname
}
style={{ width: "100%" }}
renderInput={(params) => (
Expand Down

0 comments on commit 357fb62

Please sign in to comment.