Skip to content
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

Request: Allow immediate typing if current value == 0 or 0.00 #62

Open
StainlessStlRat opened this issue May 2, 2024 · 1 comment
Open
Assignees

Comments

@StainlessStlRat
Copy link

When the user clicks on a field that has already been pre-populated with a 0 value, it'd be nice if it allowed typing the new value immediately. Right now, a user has to delete all of the zeros before they begin typing a new value.

As a workaround I'm leaving it empty currently, but this behavior diverges from how I have this implemented in the iOS version of my app, so not perfectly ideal.

@efguydan efguydan self-assigned this May 6, 2024
@efguydan
Copy link
Member

efguydan commented May 6, 2024

Hey @StainlessStlRat, Thanks for leaving the issue.

If I understand you correctly, you have pre-populated an initial value of $ 0.00 here and the users have to clear this before they can type in a value.

(Working with an assumption that the edit text has been set up with a $ currency value and 2 decimal places)
This is an intentional behaviour and isn't considered a bug.
The reason is that 0.00 is indeed an accepted value for the field and won't accept any more values as that is the maximum decimal places allowed

For your problem, what you may be looking for is a hint. To set the users. with a placeholder guiding them with what can be filled here, without actually populating the field.
Here is a code snippet showing what I mean

<com.cottacush.android.currencyedittext.CurrencyEditText
    app:currencySymbol="$"
    app:useCurrencySymbolAsHint="false"
    android:hint="$ 0.000"
    app:maxNumberOfDecimalDigits="3"
...

Here is the result that will be achieved from this snippet

expected_beh.mp4

Is this what you were looking to achieve?
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants