fix(webapp): Money In dialog fields not showing after account selection
Fixed the Money In dialog where form fields were not appearing after selecting the transaction type and current account. The issue was that AccountsSuggestField (non-Formik version) was being used instead of FAccountsSuggestField. The non-Formik version doesn't update Formik's form values, so the condition in MoneyInContentFields that checks values.cashflow_account_id was never satisfied. Also updated MoneyOutDialog to use onItemChange prop for consistency. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -19,7 +19,7 @@ import { useMoneyInDailogContext } from './MoneyInDialogProvider';
|
||||
*/
|
||||
export default function TransactionTypeFields() {
|
||||
// Money in dialog context.
|
||||
const { cashflowAccounts, setAccountId } = useMoneyInDailogContext();
|
||||
const { cashflowAccounts, setAccountId, accountId } = useMoneyInDailogContext();
|
||||
|
||||
// Retrieves the add money in button options.
|
||||
const addMoneyInOptions = useMemo(() => getAddMoneyInOptions(), []);
|
||||
@@ -55,8 +55,8 @@ export default function TransactionTypeFields() {
|
||||
<FAccountsSuggestField
|
||||
name={'cashflow_account_id'}
|
||||
items={cashflowAccounts}
|
||||
onItemSelect={({ id }) => {
|
||||
setAccountId(id);
|
||||
onItemChange={(value) => {
|
||||
setAccountId(value);
|
||||
}}
|
||||
/>
|
||||
</FFormGroup>
|
||||
|
||||
@@ -60,8 +60,8 @@ function TransactionTypeFields() {
|
||||
<FAccountsSuggestField
|
||||
name={'cashflow_account_id'}
|
||||
items={cashflowAccounts}
|
||||
onItemSelect={({ id }) => {
|
||||
setAccountId(id);
|
||||
onItemChange={(value) => {
|
||||
setAccountId(value);
|
||||
}}
|
||||
/>
|
||||
</FFormGroup>
|
||||
|
||||
Reference in New Issue
Block a user