From 539cb0e5cfdccf3d6b3540fc58da3ed64225d2f7 Mon Sep 17 00:00:00 2001
From: Matiss Janis Aboltins <matiss@mja.lv>
Date: Thu, 4 May 2023 18:05:44 +0100
Subject: [PATCH] :bug: (transactions) create transaction when clicking enter
 (#992)

Closes #943

Creates the transaction when clicking "enter". Irrelevant of which field
is currently active.
---
 .../src/components/accounts/TransactionsTable.js            | 3 ---
 .../src/components/accounts/TransactionsTable.test.js       | 2 +-
 upcoming-release-notes/992.md                               | 6 ++++++
 3 files changed, 7 insertions(+), 4 deletions(-)
 create mode 100644 upcoming-release-notes/992.md

diff --git a/packages/desktop-client/src/components/accounts/TransactionsTable.js b/packages/desktop-client/src/components/accounts/TransactionsTable.js
index c5e080194..a6fd0de72 100644
--- a/packages/desktop-client/src/components/accounts/TransactionsTable.js
+++ b/packages/desktop-client/src/components/accounts/TransactionsTable.js
@@ -1619,9 +1619,6 @@ export let TransactionTable = React.forwardRef((props, ref) => {
             // add split
             onAddSplit(lastTransaction.id);
           } else if (
-            (newNavigator.focusedField === 'debit' ||
-              newNavigator.focusedField === 'credit' ||
-              newNavigator.focusedField === 'cleared') &&
             newNavigator.editingId === lastTransaction.id &&
             (!isSplit || !lastTransaction.error)
           ) {
diff --git a/packages/desktop-client/src/components/accounts/TransactionsTable.test.js b/packages/desktop-client/src/components/accounts/TransactionsTable.test.js
index a7e039506..de3c7911f 100644
--- a/packages/desktop-client/src/components/accounts/TransactionsTable.test.js
+++ b/packages/desktop-client/src/components/accounts/TransactionsTable.test.js
@@ -643,7 +643,7 @@ describe('Transactions', () => {
 
     input = await editNewField(container, 'notes');
     await userEvent.clear(input);
-    await userEvent.type(input, 'a transaction[Enter]');
+    await userEvent.type(input, 'a transaction');
 
     input = await editNewField(container, 'debit');
     expect(input.value).toBe('0.00');
diff --git a/upcoming-release-notes/992.md b/upcoming-release-notes/992.md
new file mode 100644
index 000000000..9275329ec
--- /dev/null
+++ b/upcoming-release-notes/992.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [MatissJanis]
+---
+
+Allow creating transactions by clicking "enter" in the notes/payee/category field
-- 
GitLab