New transaction text deselection on alt tab (#4921)

* changed default amount to come from amountToCurrency to handle localized values and maintain focus

* release notes

---------

Co-authored-by: Alec Bakholdin <alecbakholdin@Alecs-Mac.local>
This commit is contained in:
Alec Bakholdin
2025-05-08 12:11:02 -04:00
committed by GitHub
parent 64caf0f28b
commit 17173d3ff0
2 changed files with 9 additions and 2 deletions

View File

@@ -66,6 +66,7 @@ import {
integerToCurrency,
amountToInteger,
titleFirst,
amountToCurrency,
} from 'loot-core/shared/util';
import { useDispatch } from '../../redux';
@@ -1489,7 +1490,7 @@ const Transaction = memo(function Transaction({
name="debit"
exposed={focusedField === 'debit'}
focused={focusedField === 'debit'}
value={debit === '' && credit === '' ? '0.00' : debit}
value={debit === '' && credit === '' ? amountToCurrency(0) : debit}
valueStyle={valueStyle}
textAlign="right"
title={debit}
@@ -1500,7 +1501,7 @@ const Transaction = memo(function Transaction({
...amountStyle,
}}
inputProps={{
value: debit === '' && credit === '' ? '0.00' : debit,
value: debit === '' && credit === '' ? amountToCurrency(0) : debit,
onUpdate: onUpdate.bind(null, 'debit'),
}}
privacyFilter={{

View File

@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [alecbakholdin]
---
Made default string for transaction editing respect localization of commas and periods