From a5d591fed7e589e76b5063d45ce750b001faeca4 Mon Sep 17 00:00:00 2001 From: sveselinovic <58487477+sveselinovic@users.noreply.github.com> Date: Tue, 7 Jan 2025 21:57:53 +0100 Subject: [PATCH] fix: creating new payee with 'one of'-condition broken (#4099) * fix: creating new payee with 'one of'-condition broken * change author and description of release note --- .../components/autocomplete/Autocomplete.tsx | 19 ++++++++++--------- upcoming-release-notes/4099.md | 6 ++++++ 2 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 upcoming-release-notes/4099.md diff --git a/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx b/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx index ff8bc36c3ad..d7b4edcef3f 100644 --- a/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx +++ b/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx @@ -1,14 +1,14 @@ // @ts-strict-ignore import React, { - useState, - useRef, - useEffect, - useMemo, + type ChangeEvent, type ComponentProps, type HTMLProps, - type ReactNode, type KeyboardEvent, - type ChangeEvent, + type ReactNode, + useEffect, + useMemo, + useRef, + useState, } from 'react'; import { css, cx } from '@emotion/css'; @@ -17,7 +17,7 @@ import Downshift, { type StateChangeTypes } from 'downshift'; import { getNormalisedString } from 'loot-core/src/shared/normalisation'; import { SvgRemove } from '../../icons/v2'; -import { theme, styles } from '../../style'; +import { styles, theme } from '../../style'; import { Button } from '../common/Button'; import { Input } from '../common/Input'; import { Popover } from '../common/Popover'; @@ -649,10 +649,10 @@ function MultiAutocomplete({ onSelect(items); } - function onAddItem(id: T['id']) { + function onAddItem(id: T['id'], value: string) { if (id) { id = id.trim(); - onSelect([...selectedItemIds, id], id); + onSelect([...selectedItemIds, id], value); } } @@ -738,6 +738,7 @@ type AutocompleteFooterProps = { embedded?: boolean; children: ReactNode; }; + export function AutocompleteFooter({ show = true, embedded, diff --git a/upcoming-release-notes/4099.md b/upcoming-release-notes/4099.md new file mode 100644 index 00000000000..0c8e684ea1a --- /dev/null +++ b/upcoming-release-notes/4099.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [sveselinovic] +--- + +Fix resulting wrong name when creating a new payee in rule with the condition set to "one of"