fix(webapp): customer/vendor select should update deps

This commit is contained in:
Ahmed Bouhuolia
2023-06-22 22:07:39 +02:00
parent 4b95c19d3e
commit 5f191cf335
18 changed files with 56 additions and 26 deletions

View File

@@ -341,9 +341,9 @@ function PaymentReceiveCustomerSelect() {
inline={true}
labelInfo={<FieldRequiredHint />}
name={'customer_id'}
customers={customers}
fastField={true}
shouldUpdate={customersFieldShouldUpdate}
shouldUpdateDeps={{ items: customers }}
>
<CustomersSelect
name={'customer_id'}
@@ -358,6 +358,8 @@ function PaymentReceiveCustomerSelect() {
disabled={!isNewMode}
allowCreate={true}
fastField={true}
shouldUpdate={customersFieldShouldUpdate}
shouldUpdateDeps={{ items: customers }}
/>
{values.customer_id && (
<CustomerButtonLink customerId={values.customer_id}>

View File

@@ -129,7 +129,7 @@ export const fullAmountPaymentEntries = (entries) => {
*/
export const customersFieldShouldUpdate = (newProps, oldProps) => {
return (
newProps.customers !== oldProps.customers ||
newProps.shouldUpdateDeps.items !== oldProps.shouldUpdateDeps.items ||
defaultFastFieldShouldUpdate(newProps, oldProps)
);
};