mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
fix(webapp): customer/vendor select should update deps
This commit is contained in:
@@ -185,9 +185,10 @@ function VendorCreditFormVendorSelect() {
|
||||
name={'vendor_id'}
|
||||
label={<T id={'vendor_name'} />}
|
||||
inline={true}
|
||||
vendors={vendors}
|
||||
shouldUpdate={vendorsFieldShouldUpdate}
|
||||
labelInfo={<FieldRequiredHint />}
|
||||
fastField={true}
|
||||
shouldUpdate={vendorsFieldShouldUpdate}
|
||||
shouldUpdateDeps={{ items: vendors }}
|
||||
>
|
||||
<VendorsSelect
|
||||
name={'vendor_id'}
|
||||
@@ -199,6 +200,9 @@ function VendorCreditFormVendorSelect() {
|
||||
}}
|
||||
popoverFill={true}
|
||||
allowCreate={true}
|
||||
fastField={true}
|
||||
shouldUpdate={vendorsFieldShouldUpdate}
|
||||
shouldUpdateDeps={{ items: vendors }}
|
||||
/>
|
||||
{values.vendor_id && (
|
||||
<VendorButtonLink vendorId={values.vendor_id}>
|
||||
|
||||
@@ -113,7 +113,7 @@ export const transformFormValuesToRequest = (values) => {
|
||||
*/
|
||||
export const vendorsFieldShouldUpdate = (newProps, oldProps) => {
|
||||
return (
|
||||
newProps.vendors !== oldProps.vendors ||
|
||||
newProps.shouldUpdateDeps.items !== oldProps.shouldUpdateDeps.items ||
|
||||
defaultFastFieldShouldUpdate(newProps, oldProps)
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user