Skip to content

A local-first personal finance app

[AI] Fix transaction row drag breaking inline text edits (#7572)

Stephen Brown II880bb6742330
diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.tsx b/packages/desktop-client/src/components/transactions/TransactionsTable.tsx
index aa7f94cfb0..2e80273952 100644
--- a/packages/desktop-client/src/components/transactions/TransactionsTable.tsx
+++ b/packages/desktop-client/src/components/transactions/TransactionsTable.tsx
@@ -1215,10 +1215,18 @@ const Transaction = memo(function Transaction({
? siblingCount <= 1
: prevRowDate !== transaction.date && nextRowDate !== transaction.date;
const previewRef = useRef<DragPreviewRenderer>(null);
+ // Row-level drag must not compete with inline editors (notes, amounts,
+ // payee, etc.): otherwise clicks/drags inside inputs start a reorder drag
+ // instead of moving the caret or selecting text (see GH #7567).
+ const allowRowDrag =
+ canDrag &&
+ !isPreview &&
+ !isOnlyTransactionOnDate &&
+ (!editing || focusedField === 'select' || focusedField === 'cleared');
const { dragRef, dragProps } = useDrag<TransactionEntity>({
item: originalTransaction,
type: 'transaction',
- canDrag: canDrag && !isPreview && !isOnlyTransactionOnDate,
+ canDrag: allowRowDrag,
onDragChange,
preview: previewRef,
});
diff --git a/upcoming-release-notes/7572.md b/upcoming-release-notes/7572.md
new file mode 100644
index 0000000000..bc8f816bd2
--- /dev/null
+++ b/upcoming-release-notes/7572.md
@@ -0,0 +1,6 @@
+---
+category: Bugfixes
+authors: [StephenBrown2]
+---
+
+Fix transaction row drag interfering with inline text edits.