mirror of
https://github.com/Sea-Haven-Industries/proposal-system.git
synced 2026-09-30 10:03:14 +00:00
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:
parent
9b97b7b578
commit
2645d970ed
1 changed files with 6 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue