New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Mobile] Fix comma handling in split transaction #2661
[Mobile] Fix comma handling in split transaction #2661
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
2e9aa4f
to
f39cf90
Compare
f39cf90
to
7841482
Compare
@@ -74,8 +74,9 @@ export function AmountInput({ | |||
} | |||
|
|||
function onInputTextChange(val) { | |||
setValue(val ? val : ''); | |||
onChangeValue?.(val); | |||
const value = format(val, 'string').replace(',', '.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably do this in onBlur/onUpdate instead of onChange
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Value has already no information about commas, so we cannot tell if it is for example 42
or 4,2
or 0,42
here in TransactionEdit.jsx. Please correct me if I'm wrong.
Hello @sierikov @joel-jeremy I came across this PR while working on a similar feature request (#2318 with PR #2672). The proposed change here breaks amount entry on locales using comma as a decimal separator, on mobile and desktop as I think it would be best to have something close to what is done in actual/packages/desktop-client/src/components/mobile/transactions/FocusableAmountInput.tsx Line 71 in f8af8f9
The issue is on mobile were the number keypad is used, which greatly limits the available inputs of the user. In that context, we can rather safely consider that the thousand separator will not be present, and that both comma and dot can be considered as decimal separator. So maybe a flag could be added to |
Add autocorrection to the field, to reduce code impact
7841482
to
ddfe0b5
Compare
@sierikov @Wizmaster Would it be possible to make |
After reviewing the implementation of What do you think? @Wizmaster |
The issue linked to this PR has been closed. Does this PR also need to be closed? |
I think no. I'm currently experiencing difficulty in inputting the accurate amount via the mobile app, particularly when the format is set to |
So if I understand this correctly, iOS is showing Why would you not also configure Actual's settings to indicate |
Apologies for any confusion caused by my previous message. Upon further investigation, it appears that we do have the ability to enable dot separators on iOS. You can achieve this by navigating to Settings -> General -> Language & Region -> Number Format -> selecting 1,234,567.89. With this solution in hand, we can now consider the issue resolved and proceed to close the corresponding PR. |
Attempt to solve #2629. This fix dynamically replaces a comma with a dot in "Split transaciton" mode on mobile devices.