Skip to content

A local-first personal finance app

:bug: fix split popover (#7372)

youngcw353e12a0092d
diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.tsx b/packages/desktop-client/src/components/transactions/TransactionsTable.tsx
index 46373f4283..8d46e65207 100644
--- a/packages/desktop-client/src/components/transactions/TransactionsTable.tsx
+++ b/packages/desktop-client/src/components/transactions/TransactionsTable.tsx
@@ -1165,16 +1165,16 @@ const Transaction = memo(function Transaction({
// a variable (with a small delay in order for the next render cycle to pick up
// the change instead of the current). We pass the integer to the Popover which
// causes it to re-calculate the positioning. Thus fixing the problem.
- const [_, setUpdateId] = useState(1);
useEffect(() => {
// The hack applies to only transactions with split errors
if (!splitError) {
return;
}
- setTimeout(() => {
- setUpdateId(state => state + 1);
+ const id = setTimeout(() => {
+ window.dispatchEvent(new Event('resize')); //Force popover to recalculate position
}, 1);
+ return () => clearTimeout(id);
}, [splitError, allTransactions]);
const { setMenuOpen, menuOpen, handleContextMenu, position } =
diff --git a/upcoming-release-notes/7372.md b/upcoming-release-notes/7372.md
new file mode 100644
index 0000000000..fe7efa344b
--- /dev/null
+++ b/upcoming-release-notes/7372.md
@@ -0,0 +1,6 @@
+---
+category: Bugfixes
+authors: [youngcw, victle]
+---
+
+Fix split transaction popover not rendering properly