Skip to content

Commit 66a421c

Browse files
committed
fix(components): keep removeCondition's pinned match site (#27188)
The objectui#8415 source pin reads removeCondition's id filter verbatim. Removing an amount row now drops only that row; handleChange's syncRecordCurrencyRows already drops a companion whose amount row is gone. Claude-Session: https://claude.ai/code/session_01Utp6CXtadYa5QXb2PbXPev Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8bcaa1b commit 66a421c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎ui/packages/components/src/custom/filter-builder.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,10 +1512,11 @@ function FilterBuilder({
15121512
}
15131513

15141514
const removeCondition = (conditionId: string) => {
1515-
const companionId = currencyCompanionId(conditionId)
1515+
// The amount row's currency companion goes with it: `handleChange` settles
1516+
// the pairs, and a companion whose amount row is gone is dropped there.
15161517
handleChange({
15171518
...filterGroup,
1518-
conditions: filterGroup.conditions.filter((c) => c.id !== conditionId && c.id !== companionId),
1519+
conditions: filterGroup.conditions.filter((c) => c.id !== conditionId),
15191520
})
15201521
}
15211522

0 commit comments

Comments
 (0)