mirror of
https://github.com/actualbudget/actual.git
synced 2026-05-07 04:18:51 -05:00
[AI] Fix transaction row drag breaking inline text edits (#7572)
* [AI] fix: disable transaction row drag while editing input cells Row-level useDrag competed with notes/payee/amount fields (GH #7567). Disable reorder drag when the row is in edit mode except for select/cleared columns. * Add release notes
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
6
upcoming-release-notes/7572.md
Normal file
6
upcoming-release-notes/7572.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Bugfixes
|
||||
authors: [StephenBrown2]
|
||||
---
|
||||
|
||||
Fix transaction row drag interfering with inline text edits.
|
||||
Reference in New Issue
Block a user