mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
fix(webapp): customer/vendor select should update deps
This commit is contained in:
@@ -191,11 +191,11 @@ function CreditNoteCustomersSelect() {
|
||||
<FFormGroup
|
||||
name={'customer_id'}
|
||||
label={<T id={'customer_name'} />}
|
||||
customers={customers}
|
||||
labelInfo={<FieldRequiredHint />}
|
||||
inline={true}
|
||||
fastField={true}
|
||||
shouldUpdate={customerNameFieldShouldUpdate}
|
||||
shouldUpdateDeps={{ items: customers }}
|
||||
>
|
||||
<CustomersSelect
|
||||
name={'customer_id'}
|
||||
@@ -207,6 +207,9 @@ function CreditNoteCustomersSelect() {
|
||||
}}
|
||||
popoverFill={true}
|
||||
allowCreate={true}
|
||||
fastField={true}
|
||||
shouldUpdate={customerNameFieldShouldUpdate}
|
||||
shouldUpdateDeps={{ items: customers }}
|
||||
/>
|
||||
{values.customer_id && (
|
||||
<CustomerButtonLink customerId={values.customer_id}>
|
||||
|
||||
@@ -116,7 +116,7 @@ export const transformFormValuesToRequest = (values) => {
|
||||
*/
|
||||
export const customerNameFieldShouldUpdate = (newProps, oldProps) => {
|
||||
return (
|
||||
newProps.customers !== oldProps.customers ||
|
||||
newProps.shouldUpdateDeps.items !== oldProps.shouldUpdateDeps.items ||
|
||||
defaultFastFieldShouldUpdate(newProps, oldProps)
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user