Merge branch 'feature/IO-3515-ocr-bill-posting' into release/2026-02-27
This commit is contained in:
@@ -8,11 +8,19 @@ import PhoneNumberFormatter from "../../utils/PhoneFormatter";
|
||||
const VendorSearchSelect = ({ value, onChange, options, onSelect, disabled, preferredMake, showPhone, ref }) => {
|
||||
const [option, setOption] = useState(value);
|
||||
|
||||
// Sync internal state when value prop changes (e.g., from form.setFieldsValue)
|
||||
useEffect(() => {
|
||||
if (value !== option && onChange) {
|
||||
onChange(option);
|
||||
if (value !== option) {
|
||||
setOption(value);
|
||||
}
|
||||
}, [value, option, onChange]);
|
||||
}, [value, option]);
|
||||
|
||||
const handleChange = (newValue) => {
|
||||
setOption(newValue);
|
||||
if (onChange) {
|
||||
onChange(newValue);
|
||||
}
|
||||
};
|
||||
|
||||
const favorites =
|
||||
preferredMake && options
|
||||
@@ -103,7 +111,7 @@ const VendorSearchSelect = ({ value, onChange, options, onSelect, disabled, pref
|
||||
);
|
||||
}}
|
||||
popupMatchSelectWidth={false}
|
||||
onChange={setOption}
|
||||
onChange={handleChange}
|
||||
onSelect={onSelect}
|
||||
disabled={disabled || false}
|
||||
optionLabelProp="name"
|
||||
|
||||
Reference in New Issue
Block a user