Fix customer name not binding from Autocomplete free text input

The freeSolo Autocomplete only updated customerName on dropdown
selection, not on typed input. Update form state on onInputChange
so validation passes when typing a new customer name.
This commit is contained in:
Adam Moussa 2026-05-20 17:24:14 -04:00
parent 9b97b7b578
commit 2645d970ed

View file

@ -130,7 +130,12 @@ export default function ProposalFormPage() {
options={customers}
getOptionLabel={(opt) => (typeof opt === 'string' ? opt : opt.name)}
loading={customerLoading}
onInputChange={(_, value) => searchCustomers(value)}
onInputChange={(_, value, reason) => {
if (reason === 'input') {
handleChange('customerName', value);
}
searchCustomers(value);
}}
onChange={handleCustomerSelect}
renderInput={(params) => (
<TextField