Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/components/inputs/company-input-v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const CompanyInputV2 = ({ summitId, isRequired, sx, onChange, id, name, label, v
name={name}
options={options}
autoComplete
autoSelect
freeSolo
includeInputInList
filterSelectedOptions
Expand All @@ -82,6 +83,10 @@ const CompanyInputV2 = ({ summitId, isRequired, sx, onChange, id, name, label, v
name: newValue.inputValue
};
}
// autoSelect commits the raw typed/autofilled string on blur; normalize to {id, name}.
if (typeof tmpValue === "string" && tmpValue.trim()) {
tmpValue = { id: 0, name: tmpValue.trim() };
}
setOptions(tmpValue ? [tmpValue, ...options] : options);
let ev = {
target: {
Expand Down
Loading